1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Michael Niedermayer 2012-03-10 22:02:46 +01:00 committed by Martin Storsjö
parent 35cbc98b72
commit af11fa5409

View File

@ -242,6 +242,13 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
if (nb_components <= 0 || if (nb_components <= 0 ||
nb_components > MAX_COMPONENTS) nb_components > MAX_COMPONENTS)
return -1; 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)) { if (s->ls && !(s->bits <= 8 || nb_components == 1)) {
avpriv_report_missing_feature(s->avctx, avpriv_report_missing_feature(s->avctx,
"JPEG-LS that is not <= 8 " "JPEG-LS that is not <= 8 "