Bug 1186725 - InitTextures should check if LockRect() returns an error, r=mattwoodrow
authorAndrea Marchesini <amarchesini@mozilla.com>
Mon, 10 Aug 2015 14:47:22 +0100
changeset 289671 e5c33ca97b63199cb744e8b3feb74f991733f927
parent 289670 1199c7fed1fe9bb4fb01dac51dce9d63b4949da8
child 289672 fae9a7b76008b29753061c2f6ba7dfb3b059c265
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)
reviewersmattwoodrow
bugs1186725
milestone42.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 1186725 - InitTextures should check if LockRect() returns an error, r=mattwoodrow
gfx/layers/IMFYCbCrImage.cpp
--- a/gfx/layers/IMFYCbCrImage.cpp
+++ b/gfx/layers/IMFYCbCrImage.cpp
@@ -84,18 +84,18 @@ InitTextures(IDirect3DDevice9* aDevice,
                                     byRef(tmpTexture), nullptr))) {
     return nullptr;
   }
   if (!tmpTexture) {
     return nullptr;
   }
 
   tmpTexture->GetSurfaceLevel(0, byRef(aSurface));
-  aSurface->LockRect(&aLockedRect, nullptr, 0);
-  if (!aLockedRect.pBits) {
+  if (FAILED(aSurface->LockRect(&aLockedRect, nullptr, 0)) ||
+      !aLockedRect.pBits) {
     NS_WARNING("Could not lock surface");
     return nullptr;
   }
 
   return result.forget();
 }
 
 static bool