1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

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>
This commit is contained in:
Martin Storsjö 2013-09-20 11:16:57 +03:00
parent ede508443e
commit b772b0e28e

View File

@ -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;