summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsotaro <sotaro.ikeda.g@gmail.com>2020-02-14 10:46:53 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-02-14 10:46:53 +0100
commit8ec76186334df9dc87fc8aa7aa5edc84d977d776 (patch)
treeb1f5c7ee64f0034940ad8063627d842935883e9d
parent0a5784d3ced3b4c1cc9502d767df165e722d0b83 (diff)
downloadUXP-8ec76186334df9dc87fc8aa7aa5edc84d977d776.tar
UXP-8ec76186334df9dc87fc8aa7aa5edc84d977d776.tar.gz
UXP-8ec76186334df9dc87fc8aa7aa5edc84d977d776.tar.lz
UXP-8ec76186334df9dc87fc8aa7aa5edc84d977d776.tar.xz
UXP-8ec76186334df9dc87fc8aa7aa5edc84d977d776.zip
[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 b342f1d18..8df7af4a8 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;
}