Bug 1257931 - Fix assert in VBRI header parsing to actually check that we've been passed a reader starting with a frame sync. r=esawin
authorJan Henning <jh+bugzilla@buttercookie.de>
Fri, 18 Mar 2016 17:17:20 +0100
changeset 289561 f379a01f7e66f446931ebe8639714566c77cb32f
parent 289560 f5b01783baaa9114f8dcd90ba40dcfdf147739c1
child 289562 dd94eb69270aaa0e710fe25a496fbb64d31bcaa0
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersesawin
bugs1257931
milestone48.0a1
Bug 1257931 - Fix assert in VBRI header parsing to actually check that we've been passed a reader starting with a frame sync. r=esawin
dom/media/MP3Demuxer.cpp
--- a/dom/media/MP3Demuxer.cpp
+++ b/dom/media/MP3Demuxer.cpp
@@ -1050,17 +1050,17 @@ FrameParser::VBRHeader::ParseVBRI(ByteRe
   static const uint32_t TAG = BigEndian::readUint32("VBRI");
   static const uint32_t OFFSET = 32 + FrameParser::FrameHeader::SIZE;
   static const uint32_t FRAME_COUNT_OFFSET = OFFSET + 14;
   static const uint32_t MIN_FRAME_SIZE = OFFSET + 26;
 
   MOZ_ASSERT(aReader);
   // ParseVBRI assumes that the ByteReader offset points to the beginning of a frame,
   // therefore as a simple check, we look for the presence of a frame sync at that position.
-  MOZ_ASSERT(aReader->PeekU16() & 0xFFE0);
+  MOZ_ASSERT((aReader->PeekU16() & 0xFFE0) == 0xFFE0);
   const size_t prevReaderOffset = aReader->Offset();
 
   // VBRI have a fixed relative position, so let's check for it there.
   if (aReader->Remaining() > MIN_FRAME_SIZE) {
     aReader->Seek(prevReaderOffset + OFFSET);
     if (aReader->ReadU32() == TAG) {
       aReader->Seek(prevReaderOffset + FRAME_COUNT_OFFSET);
       mNumAudioFrames = Some(aReader->ReadU32());