diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2019-03-15 23:16:48 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-03-15 23:16:48 +0000 |
| commit | 1069e620f0242dd699d97f3a71b4dbdb8e7b2fa9 (patch) | |
| tree | a007eea9667761ec8fe1711a1431e65247d8908e | |
| parent | 0f3c477f35f6f106e0ba04d88fceed1378ae515b (diff) | |
| parent | 4ab675581dcf4ba6ec4227b2ad11beb05c1cbd2a (diff) | |
| download | platform_external_libvpx-nougat-mr0.5-release.tar.gz platform_external_libvpx-nougat-mr0.5-release.tar.bz2 platform_external_libvpx-nougat-mr0.5-release.zip | |
Merge cherrypicks of [6738238, 6739193, 6738335, 6738239, 6739470, 6739471, 6738201, 6738202, 6738203, 6738204, 6738205, 6738206, 6738207, 6738208, 6738209, 6739510, 6739511, 6739512, 6739513, 6739514, 6739515, 6739516, 6738336, 6739517, 6739518, 6738416, 6738417, 6739472, 6739473, 6739519, 6739520, 6739071, 6739072, 6738695, 6738696, 6738697, 6738698, 6738699, 6738243, 6739521, 6738244, 6738153, 6738154, 6738155, 6738156, 6738157, 6738158, 6738159, 6738160, 6739522, 6739523] into nyc-bugfix-releaseandroid-7.0.0_r36nougat-mr0.5-release
Change-Id: I079b726a0b237133e172e8ce04cbd276b6217b25
| -rw-r--r-- | libwebm/mkvparser/mkvparser.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/libwebm/mkvparser/mkvparser.cc b/libwebm/mkvparser/mkvparser.cc index ff133272..70c1f043 100644 --- a/libwebm/mkvparser/mkvparser.cc +++ b/libwebm/mkvparser/mkvparser.cc @@ -4983,29 +4983,27 @@ bool PrimaryChromaticity::Parse(IMkvReader* reader, long long read_pos, if (!reader) return false; - std::auto_ptr<PrimaryChromaticity> chromaticity_ptr; + if (!*chromaticity) + *chromaticity = new PrimaryChromaticity(); - if (!*chromaticity) { - chromaticity_ptr.reset(new PrimaryChromaticity()); - } else { - chromaticity_ptr.reset(*chromaticity); - } - - if (!chromaticity_ptr.get()) + if (!*chromaticity) return false; - float* value = is_x ? &chromaticity_ptr->x : &chromaticity_ptr->y; + PrimaryChromaticity* pc = *chromaticity; + float* value = is_x ? &pc->x : &pc->y; double parser_value = 0; - const long long value_parse_status = + const long long parse_status = UnserializeFloat(reader, read_pos, value_size, parser_value); + if (parse_status < 0 || parser_value < FLT_MIN || parser_value > FLT_MAX) + return false; + *value = static_cast<float>(parser_value); - if (value_parse_status < 0 || *value < 0.0 || *value > 1.0) + if (*value < 0.0 || *value > 1.0) return false; - *chromaticity = chromaticity_ptr.release(); return true; } |
