mjpegdec: pass nb_components into ljpeg_decode_yuv_scan

Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-02-13 14:20:01 +01:00
parent 8f7c7ff2d6
commit b2e57eb5a3
1 changed files with 2 additions and 3 deletions

View File

@ -844,11 +844,10 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int p
return 0; return 0;
} }
static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor, static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int nb_components, int predictor,
int point_transform) int point_transform)
{ {
int i, mb_x, mb_y; int i, mb_x, mb_y;
const int nb_components=s->nb_components;
int bits= (s->bits+7)&~7; int bits= (s->bits+7)&~7;
int resync_mb_y = 0; int resync_mb_y = 0;
int resync_mb_x = 0; int resync_mb_x = 0;
@ -1289,7 +1288,7 @@ next_field:
if ((ret = ljpeg_decode_rgb_scan(s, nb_components, predictor, point_transform)) < 0) if ((ret = ljpeg_decode_rgb_scan(s, nb_components, predictor, point_transform)) < 0)
return ret; return ret;
} else { } else {
if ((ret = ljpeg_decode_yuv_scan(s, predictor, point_transform)) < 0) if ((ret = ljpeg_decode_yuv_scan(s, nb_components, predictor, point_transform)) < 0)
return ret; return ret;
} }
} }