mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Also treat file reading as an error if ftell
reports invalid length.
`ftell` is documented to return -1L if the function failed to get the current position indicator in the stream. The possibility is easily set aside just by checking if the function returned a negative length.
This commit is contained in:
parent
429eb3d1d5
commit
586c620609
@ -110,6 +110,8 @@ static bool read_generic_file(const char *path, void **buf, ssize_t *len)
|
|||||||
fseek(file, 0, SEEK_END);
|
fseek(file, 0, SEEK_END);
|
||||||
|
|
||||||
_len = ftell(file);
|
_len = ftell(file);
|
||||||
|
if (_len < 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
rewind(file);
|
rewind(file);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user