Commit ecc31630 authored by Michael Niedermayer's avatar Michael Niedermayer

mjpegb: Detect changing nb of planes in interlaced video.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 50f4f272
......@@ -251,6 +251,12 @@ 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)) {
av_log(s->avctx, AV_LOG_ERROR,
"only <= 8 bits/component or 16-bit gray accepted for JPEG-LS\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment