From 24964f21e4976edab156dc934c3b5ec3746b16eb Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 2 Jan 2012 17:02:41 +0100 Subject: [PATCH] jpegdec: Only enable rgb mode when there are 3 components. Signed-off-by: Michael Niedermayer --- libavcodec/mjpegdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 166c22306f..07883e2b72 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -279,7 +279,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) return -1; } - if(s->v_max==1 && s->h_max==1 && s->lossless==1) s->rgb=1; + if(s->v_max==1 && s->h_max==1 && s->lossless==1 && nb_components==3) s->rgb=1; /* if different size, realloc/alloc picture */ /* XXX: also check h_count and v_count */