Commit 1b5ec6a0 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/fic: Check if a frame is available before using it

Fixes null pointer dereference
Fixes: ficvf.avi
Found-by: 's avatarPiotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fccd85b9
......@@ -282,8 +282,13 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_WARNING, "Invalid FIC Header.\n");
/* Is it a skip frame? */
if (src[17])
if (src[17]) {
if (!ctx->final_frame) {
av_log(avctx, AV_LOG_WARNING, "Initial frame is skipped\n");
return AVERROR_INVALIDDATA;
}
goto skip;
}
nslices = src[13];
if (!nslices) {
......
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