Code: long SegmentInfo::Parse() {
  assert(m_pMuxingAppAsUTF8 == NULL);
  assert(m_pWritingAppAsUTF8 == NULL);
  assert(m_pTitleAsUTF8 == NULL);

 IMkvReader* const pReader = m_pSegment->m_pReader;

 long long pos = m_start;
 const long long stop = m_start + m_size;

  m_timecodeScale = 1000000;
  m_duration = -1;

 while (pos < stop) {
 long long id, size;

 const long status = ParseElementHeader(pReader, pos, stop, id, size);

 if (status < 0) // error
 return status;

 if (id == 0x0AD7B1) { // Timecode Scale
      m_timecodeScale = UnserializeUInt(pReader, pos, size);

 if (m_timecodeScale <= 0)
 return E_FILE_FORMAT_INVALID;
 } else if (id == 0x0489) { // Segment duration
 const long status = UnserializeFloat(pReader, pos, size, m_duration);

 if (status < 0)
 return status;

 if (m_duration < 0)
 return E_FILE_FORMAT_INVALID;
 } else if (id == 0x0D80) { // MuxingApp
 const long status =
 UnserializeString(pReader, pos, size, m_pMuxingAppAsUTF8);

 if (status)
 return status;
 } else if (id == 0x1741) { // WritingApp
 const long status =
 UnserializeString(pReader, pos, size, m_pWritingAppAsUTF8);

 if (status)
 return status;
 } else if (id == 0x3BA9) { // Title
 const long status = UnserializeString(pReader, pos, size, m_pTitleAsUTF8);

 if (status)
 return status;

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

Vulnerability Type: DoS Exec Code Mem. Corr. 
CWE ID: CWE-20
Summary: libvpx in libwebm in mediaserver in Android 4.x before 4.4.4, 5.0.x before 5.0.2, 5.1.x before 5.1.1, and 6.x before 2016-06-01 allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption) via a crafted mkv file, aka internal bug 23167726.
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)
