Bug 1173195 - Don't assert success until successful in GMPSharedMemManager. r=edwin, a=lmandel
authorChris Pearce <cpearce@mozilla.com>
Mon, 20 Jul 2015 16:17:19 +1200
changeset 275379 9190dedf78a2e06e218ee262e872da8c0f24541e
parent 275378 07cda54dec6032d7e0b64b51fd974e8240568a69
child 275380 c8ade2012d88b6d9544c0e57572188f77625dd29
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin, lmandel
bugs1173195
milestone40.0
Bug 1173195 - Don't assert success until successful in GMPSharedMemManager. r=edwin, a=lmandel
dom/media/gmp/GMPSharedMemManager.cpp
--- a/dom/media/gmp/GMPSharedMemManager.cpp
+++ b/dom/media/gmp/GMPSharedMemManager.cpp
@@ -36,18 +36,18 @@ GMPSharedMemManager::MgrAllocShmem(GMPSh
     }
   }
 
   // Didn't find a buffer free with enough space; allocate one
   size_t pagesize = ipc::SharedMemory::SystemPageSize();
   aSize = (aSize + (pagesize-1)) & ~(pagesize-1); // round up to page size
   bool retval = Alloc(aSize, aType, aMem);
   // The allocator (or NeedsShmem call) should never return less than we ask for...
-  MOZ_ASSERT(aMem->Size<uint8_t>() >= aSize);
   if (retval) {
+    MOZ_ASSERT(aMem->Size<uint8_t>() >= aSize);
     mData->mGmpAllocated[aClass]++;
   }
   return retval;
 }
 
 bool
 GMPSharedMemManager::MgrDeallocShmem(GMPSharedMem::GMPMemoryClasses aClass, ipc::Shmem& aMem)
 {