GBA: Fix memory leak when deserializing invalid savestate tags

This commit is contained in:
Jeffrey Pfau 2015-12-29 16:57:43 -05:00
parent e212157d2f
commit 71ef6666d0
1 changed files with 1 additions and 1 deletions

View File

@ -285,7 +285,7 @@ static int _loadPNGChunkHandler(png_structp png, png_unknown_chunkp chunk) {
LOAD_32(tag, 0, chunk->data);
LOAD_32(item.size, sizeof(uint32_t), chunk->data);
uLongf len = item.size;
if (item.size < 0) {
if (item.size < 0 || tag == EXTDATA_NONE || tag >= EXTDATA_MAX) {
return 0;
}
item.data = malloc(item.size);