aboutsummaryrefslogtreecommitdiffstats
path: root/tests/api/api-seek-test.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-03-11 20:29:40 -0300
committerJames Almer <jamrial@gmail.com>2017-03-12 14:29:11 -0300
commitff17c76e92cd9a9072a8771cad73c96cd620040b (patch)
treec64ad0a93d632607fb6f4b946c1d638a8ccb9503 /tests/api/api-seek-test.c
parentbdd07d7796e939e920842eb7280e1bce488fb95d (diff)
downloadffmpeg-ff17c76e92cd9a9072a8771cad73c96cd620040b.tar.gz
tests/api-seek: fix memory leak on realloc() failure
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'tests/api/api-seek-test.c')
-rw-r--r--tests/api/api-seek-test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c
index e4276eb9c8..4fd1e6ea04 100644
--- a/tests/api/api-seek-test.c
+++ b/tests/api/api-seek-test.c
@@ -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);