mirror of
https://github.com/libretro/ppsspp.git
synced 2025-01-23 17:45:04 +00:00
Add a bounds check to writeVideoImageWithRange().
Fixes crash in Jeanne d' Arc, which sends 480x480.
This commit is contained in:
parent
3468d7ddd9
commit
3d5f818095
@ -447,6 +447,11 @@ bool MediaEngine::writeVideoImageWithRange(u8* buffer, int frameWidth, int video
|
||||
u16 *imgbuf16 = (u16 *)buffer;
|
||||
u16 *data16 = (u16 *)data;
|
||||
|
||||
if (width > m_desWidth - xpos)
|
||||
width = m_desWidth - xpos;
|
||||
if (height > m_desHeight - ypos)
|
||||
height = m_desHeight - ypos;
|
||||
|
||||
switch (videoPixelMode) {
|
||||
case TPSM_PIXEL_STORAGE_MODE_32BIT_ABGR8888:
|
||||
data += (ypos * m_desWidth + xpos) * sizeof(u32);
|
||||
|
Loading…
x
Reference in New Issue
Block a user