Bug 1203736 - Convert H264::DecodeSPS assert to error return. r=jya
authorRalph Giles <giles@mozilla.com>
Thu, 10 Sep 2015 14:48:17 -0700
changeset 294987 01d3a641203f970a446948634b9dbb6f36fb5908
parent 294986 7367ddecab995ef76d068d2fa4c188e32bbba8ef
child 294988 db888b35735375727a820567d3cac8bef4baa25f
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1203736
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1203736 - Convert H264::DecodeSPS assert to error return. r=jya This lets us verify checking in a gtest.
media/libstagefright/binding/H264.cpp
--- a/media/libstagefright/binding/H264.cpp
+++ b/media/libstagefright/binding/H264.cpp
@@ -137,17 +137,19 @@ ConditionDimension(float aValue)
   if (aValue > 1.0 && aValue <= INT32_MAX)
     return int32_t(aValue);
   return 0;
 }
 
 /* static */ bool
 H264::DecodeSPS(const mozilla::MediaByteBuffer* aSPS, SPSData& aDest)
 {
-  MOZ_ASSERT(aSPS);
+  if (!aSPS) {
+    return false;
+  }
   BitReader br(aSPS);
 
   int32_t lastScale;
   int32_t nextScale;
   int32_t deltaScale;
 
   aDest.profile_idc = br.ReadBits(8);
   aDest.constraint_set0_flag = br.ReadBit();