Code: long Track::ParseContentEncodingsEntry(long long start, long long size) {
 IMkvReader* const pReader = m_pSegment->m_pReader;
  assert(pReader);

 long long pos = start;
 const long long stop = start + size;

 int count = 0;
 while (pos < stop) {
 long long id, size;
 const long status = ParseElementHeader(pReader, pos, stop, id, size);
 if (status < 0) // error
 return status;

 if (id == 0x2240) // ContentEncoding ID

       ++count;
 
     pos += size;  // consume payload
    assert(pos <= stop);
   }
 
   if (count <= 0)
     return -1;
 
  content_encoding_entries_ = new (std::nothrow) ContentEncoding* [count];
   if (!content_encoding_entries_)
     return -1;
 
  content_encoding_entries_end_ = content_encoding_entries_;

  pos = start;
 while (pos < stop) {
 long long id, size;
 long status = ParseElementHeader(pReader, pos, stop, id, size);
 if (status < 0) // error
 return status;

 if (id == 0x2240) { // ContentEncoding ID
 ContentEncoding* const content_encoding =
 new (std::nothrow) ContentEncoding();
 if (!content_encoding)
 return -1;

      status = content_encoding->ParseContentEncodingEntry(pos, size, pReader);
 if (status) {
 delete content_encoding;
 return status;
 }

 *content_encoding_entries_end_++ = content_encoding;

     }
 
     pos += size;  // consume payload
    assert(pos <= stop);
   }
 
  assert(pos == stop);
 
   return 0;
 }

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 Track::ParseContentEncodingsEntry(long long start, long long size) {
 IMkvReader* const pReader = m_pSegment->m_pReader;
  assert(pReader);

 long long pos = start;
 const long long stop = start + size;

 int count = 0;
 while (pos < stop) {
 long long id, size;
 const long status = ParseElementHeader(pReader, pos, stop, id, size);
 if (status < 0) // error
 return status;

 if (id == 0x2240) // ContentEncoding ID

       ++count;
 
     pos += size;  // consume payload
    if (pos > stop)
      return E_FILE_FORMAT_INVALID;
   }
 
   if (count <= 0)
     return -1;
 
  content_encoding_entries_ = new (std::nothrow) ContentEncoding*[count];
   if (!content_encoding_entries_)
     return -1;
 
  content_encoding_entries_end_ = content_encoding_entries_;

  pos = start;
 while (pos < stop) {
 long long id, size;
 long status = ParseElementHeader(pReader, pos, stop, id, size);
 if (status < 0) // error
 return status;

 if (id == 0x2240) { // ContentEncoding ID
 ContentEncoding* const content_encoding =
 new (std::nothrow) ContentEncoding();
 if (!content_encoding)
 return -1;

      status = content_encoding->ParseContentEncodingEntry(pos, size, pReader);
 if (status) {
 delete content_encoding;
 return status;
 }

 *content_encoding_entries_end_++ = content_encoding;

     }
 
     pos += size;  // consume payload
    if (pos > stop)
      return E_FILE_FORMAT_INVALID;
   }
 
  if (pos != stop)
    return E_FILE_FORMAT_INVALID;
 
   return 0;
 }
