summaryrefslogtreecommitdiff
path: root/libavcodec/eatgv.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-05-31 14:53:51 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-05-31 15:03:31 +0200
commit7fccc96dc3c0bb2fa2079cbf4e4cf1aff2db46c8 (patch)
treee82b6332b76c6a5015af4b6454b95fc6e0e3a9cb /libavcodec/eatgv.c
parent69277069dd225f5ae02f0215e877a06522d834d3 (diff)
eatgv: Check memory allocation
Diffstat (limited to 'libavcodec/eatgv.c')
-rw-r--r--libavcodec/eatgv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index c400b56713..a77c4c3886 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -173,7 +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));
+ int err = av_reallocp(&s->mv_codebook, num_mvs * 2 * sizeof(int));
+ if (err < 0)
+ return err;
s->num_mvs = num_mvs;
}