1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00

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

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2017-03-11 20:29:40 -03:00
parent bdd07d7796
commit ff17c76e92

View File

@ -40,8 +40,8 @@ static int add_crc_to_array(uint32_t crc, int64_t pts)
if (size_of_array == 0)
size_of_array = 10;
size_of_array *= 2;
crc_array = av_realloc(crc_array, size_of_array * sizeof(uint32_t));
pts_array = av_realloc(pts_array, size_of_array * sizeof(int64_t));
crc_array = av_realloc_f(crc_array, size_of_array, sizeof(uint32_t));
pts_array = av_realloc_f(pts_array, size_of_array, sizeof(int64_t));
if ((crc_array == NULL) || (pts_array == NULL)) {
av_log(NULL, AV_LOG_ERROR, "Can't allocate array to store crcs\n");
return AVERROR(ENOMEM);