Bug 1332199 - remove always-true assertion. draft
authorAlastor Wu <alwu@mozilla.com>
Thu, 19 Jan 2017 17:37:29 +0800
changeset 463554 55ae5cdac2bbc204522fe21f28e1b5488df2a938
parent 463549 f7d40ab58e082cd08a09d3fb64a2171ef0c534fd
child 542711 9ec694a9b05b6a2218b0f1636059d2095c1a8389
push id42103
push useralwu@mozilla.com
push dateThu, 19 Jan 2017 09:36:33 +0000
bugs1332199
milestone53.0a1
Bug 1332199 - remove always-true assertion. Because we read 8 bits from extradata, it won't exceed MAX_SPS/PPS_COUNT (256). MozReview-Commit-ID: 5qr1pDLrmvt
media/libstagefright/binding/H264.cpp
--- a/media/libstagefright/binding/H264.cpp
+++ b/media/libstagefright/binding/H264.cpp
@@ -636,17 +636,16 @@ H264::DecodeSPSDataSetFromExtraData(cons
     return false;
   }
 
   uint8_t numSps = reader.ReadU8() & 0x1f;
   if (!numSps) {
     // No SPS.
     return false;
   }
-  NS_ASSERTION(numSps <= MAX_SPS_COUNT, "Exceed the maximum SPS counts!");
 
   for (uint32_t idx = 0; idx < numSps; idx++) {
     uint16_t length = reader.ReadU16();
 
     if ((reader.PeekU8() & 0x1f) != H264_NAL_SPS) {
       // Not a SPS NAL type.
       return false;
     }
@@ -726,17 +725,16 @@ H264::DecodePPSDataSetFromExtraData(cons
       return false;
     }
   }
   uint8_t numPps = reader.ReadU8();
   if (!numPps) {
     // No PPs.
     return false;
   }
-  NS_ASSERTION(numPps <= MAX_PPS_COUNT, "Exceed the maximum PPS counts!");
 
   for (uint32_t idx = 0; idx < numPps; idx++) {
     uint16_t length = reader.ReadU16();
 
     if ((reader.PeekU8() & 0x1f) != H264_NAL_PPS) {
       // Not a PPS NAL type.
       return false;
     }