Commit a7b483f2 by Jamie Madill

Merge "Fix improper error handling in Image11."

A device lost event would improperly skip returning an error, which could lead us down a code path that would read/write to invalid locations. BUG=519642 Change-Id: Iba437b9b24cdf44320a944a85146f5f73be9f7a6 Reviewed-on: https://chromium-review.googlesource.com/293903Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> (cherry picked from commit 39939686) Reviewed-on: https://chromium-review.googlesource.com/295249Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 1e949799
...@@ -633,13 +633,13 @@ gl::Error Image11::map(D3D11_MAP mapType, D3D11_MAPPED_SUBRESOURCE *map) ...@@ -633,13 +633,13 @@ gl::Error Image11::map(D3D11_MAP mapType, D3D11_MAPPED_SUBRESOURCE *map)
ASSERT(mStagingTexture); ASSERT(mStagingTexture);
HRESULT result = deviceContext->Map(stagingTexture, subresourceIndex, mapType, 0, map); HRESULT result = deviceContext->Map(stagingTexture, subresourceIndex, mapType, 0, map);
// this can fail if the device is removed (from TDR) if (FAILED(result))
if (d3d11::isDeviceLostError(result))
{
mRenderer->notifyDeviceLost();
}
else if (FAILED(result))
{ {
// this can fail if the device is removed (from TDR)
if (d3d11::isDeviceLostError(result))
{
mRenderer->notifyDeviceLost();
}
return gl::Error(GL_OUT_OF_MEMORY, "Failed to map staging texture, result: 0x%X.", result); return gl::Error(GL_OUT_OF_MEMORY, "Failed to map staging texture, result: 0x%X.", 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