Commit 4b70bba5 authored by Paul B Mahol's avatar Paul B Mahol

zerocodec: check if there is previous frame

Fixes crash in bug #1219.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent b7159877
......@@ -65,6 +65,10 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
pic->key_frame = 1;
pic->pict_type = AV_PICTURE_TYPE_I;
} else {
if (prev == NULL) {
av_log(avctx, AV_LOG_ERROR, "No previous frame!\n");
return AVERROR_INVALIDDATA;
}
pic->key_frame = 0;
pic->pict_type = AV_PICTURE_TYPE_P;
}
......
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