Commit fde9d8c1 by Edwin Flores Committed by Commit Bot

D3D11: Add null check to Renderer11::testDeviceLost.

After experiencing a device loss, Renderer11::resetDevice can fail to recreate mDevice, leaving it null. In a following call to testDeviceLost, mDevice will be dereferenced, causing a segfault. BUG=angleproject:1457 Change-Id: Ib5be64542929441ceb7088a328c3245ae7e52f17 Reviewed-on: https://chromium-review.googlesource.com/364120Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 9aa83fe3
......@@ -74,6 +74,7 @@ Klarälvdalens Datakonsult AB
Mozilla Corp.
Ehsan Akhgari
Edwin Flores
Jeff Gilbert
Mike Hommey
Benoit Jacob
......
......@@ -2573,6 +2573,11 @@ bool Renderer11::testDeviceLost()
{
bool isLost = false;
if (!mDevice)
{
return true;
}
// GetRemovedReason is used to test if the device is removed
HRESULT result = mDevice->GetDeviceRemovedReason();
isLost = d3d11::isDeviceLostError(result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment