aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-10 22:02:46 +0100
committerLuca Barbato <lu_zero@gentoo.org>2013-09-07 10:26:14 +0200
commit68c990466990d68b740ae55db706629a6975765b (patch)
tree75f4306c37ff3b3aa90b74bc1ec3a736606b035b
parent790606cfe97ea897e72cd7d393ee653d2a56e8bd (diff)
downloadffmpeg-68c990466990d68b740ae55db706629a6975765b.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> (cherry picked from commit af11fa5409cc72fc45ca7f3527400beca10967b9) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/mjpegdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 05f2f02e61..74bbfa6b6f 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -243,6 +243,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)) {
av_log_missing_feature(s->avctx,
"For JPEG-LS anything except <= 8 bits/component"