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 739a4dfd9f
commit 421e09c9a8

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;