diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-02-19 17:43:24 -0500 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-03-22 17:33:32 -0400 |
commit | d909f43b5c773a73c8d526638744547ba4aa8c59 (patch) | |
tree | 5ca5f60824d9fa0bb85c12e34d5e8f3f27ccbc02 /libavcodec/vc1dec.c | |
parent | 0372e73f917e72c40b09270f771046fc142be4a7 (diff) | |
download | ffmpeg-d909f43b5c773a73c8d526638744547ba4aa8c59.tar.gz |
vc1dec: wmv2dec: Validate ff_intrax8_common_init return value
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 51f5c42ca4..c67fffa48a 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -314,7 +314,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx) av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) { MpegEncContext *s = &v->s; - int i; + int i, ret = AVERROR(ENOMEM); int mb_height = FFALIGN(s->mb_height, 2); /* Allocate mb bitplanes */ @@ -371,8 +371,6 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1; v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2); - ff_intrax8_common_init(&v->x8,s); - if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) { for (i = 0; i < 4; i++) { v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width); @@ -381,11 +379,15 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) } } + ret = ff_intrax8_common_init(&v->x8, s); + if (ret < 0) + goto error; + return 0; error: ff_vc1_decode_end(s->avctx); - return AVERROR(ENOMEM); + return ret; } av_cold void ff_vc1_init_transposed_scantables(VC1Context *v) |