summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsotaro <sotaro.ikeda.g@gmail.com>2020-02-14 10:46:53 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-02-15 13:20:18 +0100
commitf16336a10d36f18eb55efb1d62c7205de9e916c4 (patch)
treedc9c52601e674145aa9e356bed027bf58bac80be
parent582949cd30c2d8d20a16d3f972dabb164bddc029 (diff)
downloaduxp-f16336a10d36f18eb55efb1d62c7205de9e916c4.tar.gz
[Layers] Clear WrappingTextureSourceYCbCrBasic::mTexture correctly
-rw-r--r--gfx/layers/composite/TextureHost.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp
index b342f1d184..8df7af4a80 100644
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -555,6 +555,14 @@ void
BufferTextureHost::DeallocateDeviceData()
{
if (mFirstSource && mFirstSource->NumCompositableRefs() > 0) {
+ // WrappingTextureSourceYCbCrBasic wraps YUV format BufferTextureHost.
+ // When BufferTextureHost is destroyed, data of
+ // WrappingTextureSourceYCbCrBasic becomes invalid.
+ if (mFirstSource->AsWrappingTextureSourceYCbCrBasic() &&
+ mFirstSource->IsOwnedBy(this)) {
+ mFirstSource->SetOwner(nullptr);
+ mFirstSource->DeallocateDeviceData();
+ }
return;
}