diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-10-22 19:17:10 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2014-01-05 17:08:03 -0500 |
commit | 0e8ae6d10c609bb968c141aa2436413a55852590 (patch) | |
tree | 4d33cfc8ba52346730033b34eb839eceecd8867a | |
parent | 24a8dfd37b45d63e5f6332cfd12b58ad482f3df2 (diff) | |
download | ffmpeg-0e8ae6d10c609bb968c141aa2436413a55852590.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>
(cherry picked from commit 72072bf9de3241848ea86f68d2297b7a5d6ad49b)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-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 2f65779f2a..eb71670379 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1521,8 +1521,12 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) s->last_picture_ptr->owner2 = s; } - 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 && s->out_format != FMT_H264) { int i; |