Bug 1229945 - Null check D3D9 creation function in DXVA2Manager. r=ajones
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 07 Sep 2016 15:04:31 +1200
changeset 312944 49baab4a10994f0f41ad43eb1a40241c0413436c
parent 312943 92ca8f21c6719d256977ff548c707446f3ae9b2e
child 312945 ebac182b4d270ac90e8acb1c1bd810abd8a39694
push id30665
push usercbook@mozilla.com
push dateWed, 07 Sep 2016 15:20:43 +0000
treeherdermozilla-central@95acb9299faf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersajones
bugs1229945
milestone51.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 1229945 - Null check D3D9 creation function in DXVA2Manager. r=ajones
dom/media/platforms/wmf/DXVA2Manager.cpp
--- a/dom/media/platforms/wmf/DXVA2Manager.cpp
+++ b/dom/media/platforms/wmf/DXVA2Manager.cpp
@@ -274,16 +274,21 @@ D3D9DXVA2Manager::Init(nsACString& aFail
     return E_FAIL;
   }
 
   // Create D3D9Ex.
   HMODULE d3d9lib = LoadLibraryW(L"d3d9.dll");
   NS_ENSURE_TRUE(d3d9lib, E_FAIL);
   decltype(Direct3DCreate9Ex)* d3d9Create =
     (decltype(Direct3DCreate9Ex)*) GetProcAddress(d3d9lib, "Direct3DCreate9Ex");
+  if (!d3d9Create) {
+    NS_WARNING("Couldn't find Direct3DCreate9Ex symbol in d3d9.dll");
+    aFailureReason.AssignLiteral("Couldn't find Direct3DCreate9Ex symbol in d3d9.dll");
+    return E_FAIL;
+  }
   RefPtr<IDirect3D9Ex> d3d9Ex;
   HRESULT hr = d3d9Create(D3D_SDK_VERSION, getter_AddRefs(d3d9Ex));
   if (!d3d9Ex) {
     NS_WARNING("Direct3DCreate9 failed");
     aFailureReason.AssignLiteral("Direct3DCreate9 failed");
     return E_FAIL;
   }