Code: long mkvparser::UnserializeInt(IMkvReader* pReader, long long pos, long size,
                               long long& result) {
  assert(pReader);
  assert(pos >= 0);
  assert(size > 0);
  assert(size <= 8);
 
  {
    signed char b;
 
    const long status = pReader->Read(pos, 1, (unsigned char*)&b);
 
    if (status < 0)
      return status;
    result = b;
    ++pos;
  }
 
   for (long i = 1; i < size; ++i) {
     unsigned char b;

 const long status = pReader->Read(pos, 1, &b);

 if (status < 0)
 return status;

    result <<= 8;
    result |= b;


     ++pos;
   }
 
  return 0;  // success
 }

Commit Message: external/libvpx/libwebm: Update snapshot

Update libwebm snapshot. This update contains security fixes from upstream.

Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b

BUG=23167726

Change-Id: Id3e140e7b31ae11294724b1ecfe2e9c83b4d4207
(cherry picked from commit d0281a15b3c6bd91756e453cc9398c5ef412d99a)

CWE ID: CWE-20
long mkvparser::UnserializeInt(IMkvReader* pReader, long long pos, long size,
long UnserializeInt(IMkvReader* pReader, long long pos, long long size,
                    long long& result_ref) {
  if (!pReader || pos < 0 || size < 1 || size > 8)
    return E_FILE_FORMAT_INVALID;
 
  signed char first_byte = 0;
  const long status = pReader->Read(pos, 1, (unsigned char*)&first_byte);
 
  if (status < 0)
    return status;
 
  unsigned long long result = first_byte;
  ++pos;
 
   for (long i = 1; i < size; ++i) {
     unsigned char b;

 const long status = pReader->Read(pos, 1, &b);

 if (status < 0)
 return status;

    result <<= 8;
    result |= b;


     ++pos;
   }
 
  result_ref = static_cast<long long>(result);
  return 0;
 }
