Bug 1122367: Null check the result of D2DFactory(). r=Bas

This commit is contained in:
David Major 2015-01-20 10:56:59 +13:00
parent d89604a3ea
commit 5ea7fa8ef7

View File

@ -859,7 +859,12 @@ DrawTargetD2D1::factory()
return mFactory;
}
HRESULT hr = D2DFactory()->QueryInterface((ID2D1Factory1**)&mFactory);
ID2D1Factory* d2dFactory = D2DFactory();
if (!d2dFactory) {
return nullptr;
}
HRESULT hr = d2dFactory->QueryInterface((ID2D1Factory1**)&mFactory);
if (FAILED(hr)) {
return nullptr;