mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-11 20:44:24 +00:00
(movie.c) Be more careful with allocations
This commit is contained in:
parent
bb4888ae22
commit
4ddbde8a09
5
movie.c
5
movie.c
@ -208,6 +208,7 @@ static void bsv_movie_free(bsv_movie_t *handle)
|
||||
static bsv_movie_t *bsv_movie_init(const char *path,
|
||||
enum rarch_movie_type type)
|
||||
{
|
||||
size_t *frame_pos = NULL;
|
||||
bsv_movie_t *handle = (bsv_movie_t*)calloc(1, sizeof(*handle));
|
||||
if (!handle)
|
||||
return NULL;
|
||||
@ -222,9 +223,11 @@ static bsv_movie_t *bsv_movie_init(const char *path,
|
||||
|
||||
/* Just pick something really large
|
||||
* ~1 million frames rewind should do the trick. */
|
||||
if (!(handle->frame_pos = (size_t*)calloc((1 << 20), sizeof(size_t))))
|
||||
if (!(frame_pos = (size_t*)calloc((1 << 20), sizeof(size_t))))
|
||||
goto error;
|
||||
|
||||
handle->frame_pos = frame_pos;
|
||||
|
||||
handle->frame_pos[0] = handle->min_file_pos;
|
||||
handle->frame_mask = (1 << 20) - 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user