Merge pull request #11110 from unknownbrackets/d3d11-screenshot

D3D11: Fix crash on screenshot
This commit is contained in:
Henrik Rydgård 2018-05-31 10:40:21 +02:00 committed by GitHub
commit cae79bf979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1363,15 +1363,16 @@ bool D3D11DrawContext::CopyFramebufferToMemorySync(Framebuffer *src, int channel
if (fb) {
assert(fb->colorFormat == DXGI_FORMAT_R8G8B8A8_UNORM);
// TODO: Figure out where the badness really comes from.
if (bx + bw > fb->width) {
bw -= (bx + bw) - fb->width;
}
if (by + bh > fb->height) {
bh -= (by + bh) - fb->height;
}
}
// TODO: Figure out where the badness really comes from.
if (bx + bw > fb->width) {
bw -= (bx + bw) - fb->width;
}
if (by + bh > fb->height) {
bh -= (by + bh) - fb->height;
}
if (bh <= 0 || bw <= 0)
return true;