Commit 6105b721 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/vp3: Clear context on reinitialization failure

Fixes null pointer dereference
Fixes: 1536b9b096a8f95b742bae9d3d761cc6/signal_sigsegv_294aaed_2039_8d1797aeb823ea43858d0fa45c9eb899.ogv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent d85aa761
......@@ -2018,17 +2018,19 @@ static int vp3_decode_frame(AVCodecContext *avctx,
vp3_decode_end(avctx);
ret = theora_decode_header(avctx, &gb);
if (ret >= 0)
ret = vp3_decode_init(avctx);
if (ret < 0) {
vp3_decode_end(avctx);
} else
ret = vp3_decode_init(avctx);
}
return ret;
} else if (type == 2) {
ret = theora_decode_tables(avctx, &gb);
if (ret >= 0)
ret = vp3_decode_init(avctx);
if (ret < 0) {
vp3_decode_end(avctx);
} else
ret = vp3_decode_init(avctx);
}
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment