mirror of https://github.com/mgba-emu/mgba.git
Util: Fix overflow when loading invalid UPS patches
This commit is contained in:
parent
181c05c7ac
commit
af77e5ab62
1
CHANGES
1
CHANGES
|
@ -21,6 +21,7 @@ Bugfixes:
|
|||
- GB MBC: Fix ROM bank overflows getting set to bank 0
|
||||
- Qt: Fix timing issues on high refresh rate monitors
|
||||
- GBA Savedata: Fix savedata unmasking (fixes mgba.io/i/441)
|
||||
- Util: Fix overflow when loading invalid UPS patches
|
||||
Misc:
|
||||
- SDL: Remove scancode key input
|
||||
- GBA Video: Clean up unused timers
|
||||
|
|
|
@ -87,6 +87,9 @@ bool _UPSApplyPatch(struct Patch* patch, const void* in, size_t inSize, void* ou
|
|||
if (patch->vf->read(patch->vf, &byte, 1) != 1) {
|
||||
return false;
|
||||
}
|
||||
if (offset >= outSize) {
|
||||
return false;
|
||||
}
|
||||
buf[offset] ^= byte;
|
||||
++offset;
|
||||
if (!byte) {
|
||||
|
|
Loading…
Reference in New Issue