aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-02 17:02:41 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-02 17:53:40 +0100
commit24964f21e4976edab156dc934c3b5ec3746b16eb (patch)
treee1903a4c41c01693766acd9db2df1c8180f1e515
parent0af34c4d2c49157d118aea48a834c51555e777ff (diff)
downloadffmpeg-24964f21e4976edab156dc934c3b5ec3746b16eb.tar.gz
jpegdec: Only enable rgb mode when there are 3 components.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mjpegdec.c2
1 files changed, 1 insertions, 1 deletions
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 */