mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 16:20:27 +00:00
(movie.c) Try to be more safe in init_playback
This commit is contained in:
parent
2f504b4057
commit
f770ea8560
10
movie.c
10
movie.c
@ -110,14 +110,16 @@ static bool init_playback(bsv_movie_t *handle, const char *path)
|
||||
|
||||
if (state_size)
|
||||
{
|
||||
retro_ctx_serialize_info_t serial_info;
|
||||
retro_ctx_size_info_t info;
|
||||
retro_ctx_serialize_info_t serial_info;
|
||||
uint8_t *buf = (uint8_t*)malloc(state_size);
|
||||
|
||||
handle->state = (uint8_t*)malloc(state_size);
|
||||
handle->state_size = state_size;
|
||||
if (!handle->state)
|
||||
if (!buf)
|
||||
return false;
|
||||
|
||||
handle->state = buf;
|
||||
handle->state_size = state_size;
|
||||
|
||||
if (fread(handle->state, 1, state_size, handle->file) != state_size)
|
||||
{
|
||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_COULD_NOT_READ_STATE_FROM_MOVIE));
|
||||
|
Loading…
x
Reference in New Issue
Block a user