mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
read_generic_file - add early return if rom_buf is NULL
This commit is contained in:
parent
0ea6dc0445
commit
932fc3d353
1 changed files with 3 additions and 0 deletions
|
@ -121,6 +121,9 @@ static bool read_generic_file(const char *path, void **buf, ssize_t *len)
|
|||
if ((ret = fread(rom_buf, 1, _len, file)) < _len)
|
||||
RARCH_WARN("Didn't read whole file.\n");
|
||||
|
||||
if (!rom_buf)
|
||||
goto error;
|
||||
|
||||
*buf = rom_buf;
|
||||
|
||||
/* Allow for easy reading of strings to be safe.
|
||||
|
|
Loading…
Add table
Reference in a new issue