You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
zerocodec: check if there is previous frame
Fixes crash in bug #1219. Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
@@ -65,6 +65,10 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
pic->key_frame = 1;
|
pic->key_frame = 1;
|
||||||
pic->pict_type = AV_PICTURE_TYPE_I;
|
pic->pict_type = AV_PICTURE_TYPE_I;
|
||||||
} else {
|
} else {
|
||||||
|
if (prev == NULL) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "No previous frame!\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
pic->key_frame = 0;
|
pic->key_frame = 0;
|
||||||
pic->pict_type = AV_PICTURE_TYPE_P;
|
pic->pict_type = AV_PICTURE_TYPE_P;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user