[FFmpeg-cvslog] ljpeg: use the correct number of components in yuv

Luca Barbato git at videolan.org
Mon Jun 3 00:46:26 CEST 2013


ffmpeg | branch: release/1.1 | Luca Barbato <lu_zero at gentoo.org> | Tue May 14 16:20:14 2013 +0200| [510a96a2116a06877b9f43f1672dbd6410be8653] | committer: Reinhard Tartler

ljpeg: use the correct number of components in yuv

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit a030279a67ef883df8cf3707774656fa1be81078)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

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

 libavcodec/mjpegdec.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 4956e3a..5b59e48 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -709,10 +709,9 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor,
 }
 
 static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
-                                 int point_transform)
+                                 int point_transform, int nb_components)
 {
     int i, mb_x, mb_y;
-    const int nb_components = 3;
 
     for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
         for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
@@ -1094,7 +1093,8 @@ next_field:
                     return ret;
             } else {
                 if ((ret = ljpeg_decode_yuv_scan(s, predictor,
-                                                 point_transform)) < 0)
+                                                 point_transform,
+                                                 nb_components)) < 0)
                     return ret;
             }
         }



More information about the ffmpeg-cvslog mailing list