PackFramebufferSync_: Check for bad parameters that could cause crash

My theory for the #7819 crash
This commit is contained in:
Henrik Rydgard committed 2016-02-11 22:10:54 +01:00
1 parent 042bfe6d83
commit 5bfeafc037
1 file changed
+6
+6
View File
@@ -1690,6 +1690,12 @@ void FramebufferManager::PackFramebufferSync_(VirtualFramebuffer *vfb, int x, in
const int dstBpp = vfb->format == GE_FORMAT_8888 ? 4 : 2;
const int packWidth = std::min(vfb->fb_stride, std::min(x + w, (int)vfb->width));
if (y >= h) {
ERROR_LOG_REPORT_ONCE(vfbfbooutofrange, SCEGE, "PackFramebufferSync_: region out of range (x,y,w,h: %d,%d,%d,%d)", x,y,w,h);
fbo_unbind_read();
return;
}
if (!convert) {
int byteOffset = y * vfb->fb_stride * 4;
packed = (GLubyte *)Memory::GetPointer(fb_address + byteOffset);