---
On top of 4/17. Reallocp takes care of freeing memory on failure.
Vittorio

 libavcodec/eatgv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index 5df4301..a73a1d3 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -173,9 +173,9 @@ static int tgv_decode_inter(TgvContext *s, AVFrame *frame,
 
     /* allocate codebook buffers as necessary */
     if (num_mvs > s->num_mvs) {
-        s->mv_codebook = av_realloc(s->mv_codebook, num_mvs*2*sizeof(int));
-        if (!s->mv_codebook)
-            return AVERROR(ENOMEM);
+        err = av_reallocp(&s->mv_codebook, num_mvs * 2 * sizeof(int));
+        if (err < 0)
+            return err;
         s->num_mvs = num_mvs;
     }
 
-- 
1.9.5 (Apple Git-50.3)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to