Skip to content
Snippets Groups Projects
Commit ff17c76e authored by James Almer's avatar James Almer
Browse files

tests/api-seek: fix memory leak on realloc() failure

parent bdd07d77
No related branches found
No related tags found
No related merge requests found
...@@ -40,8 +40,8 @@ static int add_crc_to_array(uint32_t crc, int64_t pts) ...@@ -40,8 +40,8 @@ static int add_crc_to_array(uint32_t crc, int64_t pts)
if (size_of_array == 0) if (size_of_array == 0)
size_of_array = 10; size_of_array = 10;
size_of_array *= 2; size_of_array *= 2;
crc_array = av_realloc(crc_array, size_of_array * sizeof(uint32_t)); crc_array = av_realloc_f(crc_array, size_of_array, sizeof(uint32_t));
pts_array = av_realloc(pts_array, size_of_array * sizeof(int64_t)); pts_array = av_realloc_f(pts_array, size_of_array, sizeof(int64_t));
if ((crc_array == NULL) || (pts_array == NULL)) { if ((crc_array == NULL) || (pts_array == NULL)) {
av_log(NULL, AV_LOG_ERROR, "Can't allocate array to store crcs\n"); av_log(NULL, AV_LOG_ERROR, "Can't allocate array to store crcs\n");
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment