[FFmpeg-cvslog] mjpegb: Detect changing number of planes in interlaced video

Michael Niedermayer git at videolan.org
Thu Sep 26 00:26:09 CEST 2013


ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Sat Mar 10 22:02:46 2012 +0100| [7a9af1da39009167a3dd62204ad2bfd6bbe114b7] | committer: Sean McGovern

mjpegb: Detect changing number of planes in interlaced video

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit af11fa5409cc72fc45ca7f3527400beca10967b9)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a9af1da39009167a3dd62204ad2bfd6bbe114b7
---

 libavcodec/mjpegdec.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 5256a8e..a1a6789 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -245,6 +245,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(s->avctx, AV_LOG_ERROR,
                "only <= 8 bits/component or 16-bit gray accepted for JPEG-LS\n");



More information about the ffmpeg-cvslog mailing list