summaryrefslogtreecommitdiff
path: root/libavcodec/vc1dec.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-20 11:16:57 +0300
committerMartin Storsjö <martin@martin.st>2013-09-22 21:02:47 +0300
commitb772b0e28eba6abf76d86ee8c6e459a86642db5a (patch)
treea093682614e5d81d5f128d7e9c243f930eba51a2 /libavcodec/vc1dec.c
parentede508443e4bf57dc1e019fac81bf6244b88fbd3 (diff)
vc1dec: Undo mpegvideo initialization if unable to allocate tables
Previously, s->context_initialized was left set to 1 if ff_vc1_decode_init_alloc_tables failed, skipping the initialization completely on the next decode call. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r--libavcodec/vc1dec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 35a0fe71e8..d0566a30a5 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5877,8 +5877,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
}
if (!s->context_initialized) {
- if (ff_msmpeg4_decode_init(avctx) < 0 || ff_vc1_decode_init_alloc_tables(v) < 0)
+ if (ff_msmpeg4_decode_init(avctx) < 0)
goto err;
+ if (ff_vc1_decode_init_alloc_tables(v) < 0) {
+ ff_MPV_common_end(s);
+ goto err;
+ }
s->low_delay = !avctx->has_b_frames || v->res_sprite;