diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-05-14 16:20:14 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-06-22 08:47:16 +0200 |
commit | da5cf7e45263d7e8c67d0705a403c6c88686c5bb (patch) | |
tree | b30920ffd1c24d2d0fcd4d8d9e7015720a984c0e /libavcodec | |
parent | 6711d410dc130b889f1a85a8408dd5ff99b769bf (diff) | |
download | ffmpeg-da5cf7e45263d7e8c67d0705a403c6c88686c5bb.tar.gz |
ljpeg: use the correct number of components in yuv
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit a030279a67ef883df8cf3707774656fa1be81078)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mjpegdec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 18c52b9cc0..7f1fa62ad1 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -711,10 +711,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++) { @@ -1108,7 +1107,8 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, if (ljpeg_decode_rgb_scan(s, predictor, point_transform) < 0) return -1; } else { - if (ljpeg_decode_yuv_scan(s, predictor, point_transform) < 0) + if (ljpeg_decode_yuv_scan(s, predictor, point_transform, + nb_components)) return -1; } } |