summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-04-04 13:32:09 -0700
committerMarco Nelissen <marcone@google.com>2014-04-11 17:21:44 +0000
commit9bb2fb9a522f37f4843b3e833fda2947bbaeefd0 (patch)
tree69dfc9a03636a070e9c17de2168022919273c26f
parent35e2df82cf8a89fbe4c140746369e8c84a14b599 (diff)
downloadandroid_external_libvpx-9bb2fb9a522f37f4843b3e833fda2947bbaeefd0.tar.gz
android_external_libvpx-9bb2fb9a522f37f4843b3e833fda2947bbaeefd0.tar.bz2
android_external_libvpx-9bb2fb9a522f37f4843b3e833fda2947bbaeefd0.zip
UUIDs can have their high bit set
mkvparser::UnserializeUInt() assumes that unsigned values never have their high bit set. This is too limiting for UUIDs. In addition, the Chapters::Atom::Parse() method would truncate a "negative" 64-bit UUID value to 32 bits and return the truncated value as a status code. This value then might or might not be treated as an error by the caller depending on whether the truncated value was itself negative. b/13744158 Change-Id: I95d9ba60d1e16a0de25215c4e67d694617488d59
-rw-r--r--libwebm/mkvparser.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libwebm/mkvparser.cpp b/libwebm/mkvparser.cpp
index d7a8fe1..594f302 100644
--- a/libwebm/mkvparser.cpp
+++ b/libwebm/mkvparser.cpp
@@ -4662,10 +4662,11 @@ long Chapters::Atom::Parse(
}
else if (id == 0x33C4) // UID ID
{
- const long long val = UnserializeUInt(pReader, pos, size);
+ long long val;
+ status = UnserializeInt(pReader, pos, size, val);
- if (val < 0) // error
- return static_cast<long>(val);
+ if (status < 0) // error
+ return status;
m_uid = val;
}