aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 14:20:01 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-13 14:20:46 +0100
commitb2e57eb5a3cb9d5dfab601077fa0edee91e06ca5 (patch)
tree6a46811e1a0e113ecdededb2e816f1b066734caa /libavcodec
parent8f7c7ff2d6050d1fe0a70e0781f6ea41d9c3071f (diff)
downloadffmpeg-b2e57eb5a3cb9d5dfab601077fa0edee91e06ca5.tar.gz
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mjpegdec.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index d472436778..ff37f11d4c 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -844,11 +844,10 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int p
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 i, mb_x, mb_y;
- const int nb_components=s->nb_components;
int bits= (s->bits+7)&~7;
int resync_mb_y = 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)
return ret;
} 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;
}
}