avcodec: Use av_reallocp where suitable

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Alexandra Khirnova
2013-12-06 13:44:17 +01:00
committed by Martin Storsjö
parent d4f1188d1a
commit 9b8d11a76a
10 changed files with 73 additions and 76 deletions

View File

@@ -178,7 +178,11 @@ static int tgv_decode_inter(TgvContext *s, AVFrame *frame,
}
if (num_blocks_packed > s->num_blocks_packed) {
s->block_codebook = av_realloc(s->block_codebook, num_blocks_packed*16);
int err;
if ((err = av_reallocp(&s->block_codebook, num_blocks_packed * 16)) < 0) {
s->num_blocks_packed = 0;
return err;
}
s->num_blocks_packed = num_blocks_packed;
}