diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-10-22 19:17:10 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-10-23 10:49:48 +0200 |
commit | 72072bf9de3241848ea86f68d2297b7a5d6ad49b (patch) | |
tree | 458cccaad85f5939e8e1f6180edd7f30c290c21b /libavcodec | |
parent | f6633c55a3c0e93a5b2bab6aa0692fb608f2a38d (diff) | |
download | ffmpeg-streaming-72072bf9de3241848ea86f68d2297b7a5d6ad49b.zip ffmpeg-streaming-72072bf9de3241848ea86f68d2297b7a5d6ad49b.tar.gz |
mpegvideo: Drop a faulty assert
That check is easily reachable by faulty input.
CC:libav-stable@libav.org
Reported-by: Torsten Sadowski <tsadowski@gmx.net>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 192e27f..718f946 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1633,8 +1633,12 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) return ret; } - assert(s->pict_type == AV_PICTURE_TYPE_I || (s->last_picture_ptr && - s->last_picture_ptr->f.data[0])); + if (s->pict_type != AV_PICTURE_TYPE_I && + !(s->last_picture_ptr && s->last_picture_ptr->f.data[0])) { + av_log(s, AV_LOG_ERROR, + "Non-reference picture received and no reference available\n"); + return AVERROR_INVALIDDATA; + } if (s->picture_structure!= PICT_FRAME) { int i; |