diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-10 22:02:46 +0100 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-09-03 22:58:24 +0300 |
commit | af11fa5409cc72fc45ca7f3527400beca10967b9 (patch) | |
tree | 9f520f5fc76ca4b76b112166c77b7b9de8f57bc1 /libavcodec/mjpegdec.c | |
parent | 35cbc98b720db95b923cb2d745f77bb2ee4363dc (diff) | |
download | ffmpeg-af11fa5409cc72fc45ca7f3527400beca10967b9.tar.gz |
mjpegb: Detect changing number of planes in interlaced video
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 7bca899e87..65bf2645fb 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -242,6 +242,13 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) if (nb_components <= 0 || nb_components > MAX_COMPONENTS) return -1; + if (s->interlaced && (s->bottom_field == !s->interlace_polarity)) { + if (nb_components != s->nb_components) { + av_log(s->avctx, AV_LOG_ERROR, + "nb_components changing in interlaced picture\n"); + return AVERROR_INVALIDDATA; + } + } if (s->ls && !(s->bits <= 8 || nb_components == 1)) { avpriv_report_missing_feature(s->avctx, "JPEG-LS that is not <= 8 " |