mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 03:44:32 +01:00
PackFramebufferSync_: Check for bad parameters that could cause crash
My theory for the #7819 crash
This commit is contained in:
1 parent
042bfe6d83
commit
5bfeafc037
1 file changed
+6
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user