diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-05-04 12:32:43 -0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2012-05-06 15:47:10 -0700 |
commit | 37f4a976b374398a846b354cf16417b9a81d57e2 (patch) | |
tree | b617c69f3c209c8dbdd68e3308a02f7e315601f5 /libavcodec | |
parent | e004bc16a1304822226b5b1ceebdb899d72ee538 (diff) | |
download | ffmpeg-37f4a976b374398a846b354cf16417b9a81d57e2.tar.gz |
zerocodec: check if the previous frame is missing
ZeroCodec relies on the keyframe flag being set in the container, and
prev is the previously decoded frame. A keyframe flags incorrectly set
will lead to this condition.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/zerocodec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c index 6c57e05197..487cb32797 100644 --- a/libavcodec/zerocodec.c +++ b/libavcodec/zerocodec.c @@ -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) { + av_log(avctx, AV_LOG_ERROR, "Missing reference frame!\n"); + return AVERROR_INVALIDDATA; + } pic->key_frame = 0; pic->pict_type = AV_PICTURE_TYPE_P; } |