Bug 1561667 - Ensure that SurfaceTexture is attached before calling ReleaseTexImage. r=jgilbert,rbarker
authorImanol Fernandez <mortimergoro@gmail.com>
Mon, 22 Jul 2019 21:16:11 +0000
changeset 547518 cdd04fa751fc07a28b0289af9fcd4a0df1c22f1f
parent 547517 eb72d4f96796dda5c2e9a5ede4046920f7f08681
child 547519 99a149a24c4e860e9063ec10d0f2c800a0e1817e
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, rbarker
bugs1561667
milestone70.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 1561667 - Ensure that SurfaceTexture is attached before calling ReleaseTexImage. r=jgilbert,rbarker Ensure that SurfaceTexture is attached before calling ReleaseTexImage. Differential Revision: https://phabricator.services.mozilla.com/D38679
gfx/layers/opengl/TextureHostOGL.cpp
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -599,16 +599,19 @@ void SurfaceTextureHost::SetTextureSourc
 
   if (mTextureSource) {
     mTextureSource->SetTextureSourceProvider(aProvider);
   }
 }
 
 void SurfaceTextureHost::NotifyNotUsed() {
   if (mSurfTex && mSurfTex->IsSingleBuffer()) {
+    if (!EnsureAttached()) {
+      return;
+    }
     mSurfTex->ReleaseTexImage();
   }
 
   TextureHost::NotifyNotUsed();
 }
 
 gfx::SurfaceFormat SurfaceTextureHost::GetFormat() const { return mFormat; }