mirror of https://github.com/mgba-emu/mgba.git
Core: Allow deserializing PNG savestates with ignoring extdata
This commit is contained in:
parent
80fb86a930
commit
88212fc2de
|
@ -283,7 +283,11 @@ static void* _loadPNGState(struct mCore* core, struct VFile* vf, struct mStateEx
|
|||
success = success && PNGReadFooter(png, end);
|
||||
PNGReadClose(png, info, end);
|
||||
|
||||
if (success) {
|
||||
if (!success) {
|
||||
free(pixels);
|
||||
mappedMemoryFree(state, stateSize);
|
||||
return NULL;
|
||||
} else if (extdata) {
|
||||
struct mStateExtdataItem item = {
|
||||
.size = width * height * 4,
|
||||
.data = pixels,
|
||||
|
@ -292,8 +296,6 @@ static void* _loadPNGState(struct mCore* core, struct VFile* vf, struct mStateEx
|
|||
mStateExtdataPut(extdata, EXTDATA_SCREENSHOT, &item);
|
||||
} else {
|
||||
free(pixels);
|
||||
mappedMemoryFree(state, stateSize);
|
||||
return 0;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue