Bug 1386487 - Check if D3D11Device is obsoleted in D3D11YCbCrImage::GetAsSourceSurface() r=nical
authorsotaro <sotaro.ikeda.g@gmail.com>
Mon, 04 Mar 2019 11:01:53 +0000
changeset 520099 ff6d406ee71ffdb32d6baa052e82a593352b6c8f
parent 520098 ddd00855bb2a7a07645677c145a838f41ca47626
child 520100 ba13685290eef66ac658c4a0df6f40c81c801cf3
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1386487
milestone67.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 1386487 - Check if D3D11Device is obsoleted in D3D11YCbCrImage::GetAsSourceSurface() r=nical Differential Revision: https://phabricator.services.mozilla.com/D21830
gfx/layers/D3D11YCbCrImage.cpp
--- a/gfx/layers/D3D11YCbCrImage.cpp
+++ b/gfx/layers/D3D11YCbCrImage.cpp
@@ -138,16 +138,21 @@ already_AddRefed<SourceSurface> D3D11YCb
   RefPtr<ID3D11Texture2D> texCb = dxgiData->GetD3D11Texture(1);
   RefPtr<ID3D11Texture2D> texCr = dxgiData->GetD3D11Texture(2);
   RefPtr<ID3D11Texture2D> softTexY, softTexCb, softTexCr;
   D3D11_TEXTURE2D_DESC desc;
 
   RefPtr<ID3D11Device> dev;
   texY->GetDevice(getter_AddRefs(dev));
 
+  if (!dev || dev != gfx::DeviceManagerDx::Get()->GetImageDevice()) {
+    gfxCriticalError() << "D3D11Device is obsoleted";
+    return nullptr;
+  }
+
   RefPtr<ID3D10Multithread> mt;
   hr = dev->QueryInterface((ID3D10Multithread**)getter_AddRefs(mt));
 
   if (FAILED(hr) || !mt) {
     gfxCriticalError() << "Multithread safety interface not supported.";
     return nullptr;
   }