Browse Source

eatgv: Check memory allocation

tags/n2.7
Vittorio Giovara Luca Barbato 10 years ago
parent
commit
7fccc96dc3
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/eatgv.c

+ 3
- 1
libavcodec/eatgv.c View File

@@ -173,7 +173,9 @@ static int tgv_decode_inter(TgvContext *s, AVFrame *frame,


/* allocate codebook buffers as necessary */ /* allocate codebook buffers as necessary */
if (num_mvs > s->num_mvs) { 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; s->num_mvs = num_mvs;
} }




Loading…
Cancel
Save