mupen64plus / mupen64plus-core

Core module of the Mupen64Plus project
1.29k stars 257 forks source link

Add missing ROM file size checks #1059

Closed 269261 closed 8 months ago

269261 commented 8 months ago

Fix for https://github.com/mupen64plus/mupen64plus-core/issues/1049.

Issue 2 could be fixed like this:

if Z64 format:
    no divisibility requirements
else if V64 format:
    ROM size must be divisible by 2
else if N64 format:
    ROM size must be divisible by 4

but in CoreDoCommand we don't have any information regarding file format (magic bytes are read in open_rom, after ParamInt validation). Because of that I just assumed that all ROMs sizes must be divisible by 4. If there are valid ROMs not meeting this criteria then either: