diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-20 11:16:57 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-07 09:43:57 +0100 |
commit | cd254e8540b3fce4ab83e06dc1a64f69feddd9ca (patch) | |
tree | 77f4a734aaa544207c92e4f5b35ccb7adc09541a | |
parent | 159993acc7f4e3155510d42c543e09fe972b933c (diff) | |
download | ffmpeg-cd254e8540b3fce4ab83e06dc1a64f69feddd9ca.tar.gz |
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>
(cherry picked from commit b772b0e28eba6abf76d86ee8c6e459a86642db5a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | libavcodec/vc1dec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 328c5a69c5..8c28aa9bc2 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5483,8 +5483,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, } if (!s->context_initialized) { - if (ff_msmpeg4_decode_init(avctx) < 0 || vc1_decode_init_alloc_tables(v) < 0) + if (ff_msmpeg4_decode_init(avctx) < 0) return -1; + if (vc1_decode_init_alloc_tables(v) < 0) { + MPV_common_end(s); + return -1; + } s->low_delay = !avctx->has_b_frames || v->res_sprite; |