mjpegdec: rgb mode is specific for ljpeg, disable it for others.

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-01-27 23:45:44 +01:00
parent 73abc3a634
commit 4ade824e1f
1 changed files with 2 additions and 0 deletions

View File

@ -300,6 +300,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
if (s->v_max == 1 && s->h_max == 1 && s->lossless==1 && nb_components==3)
s->rgb = 1;
else if (!s->lossless)
s->rgb = 0;
/* if different size, realloc/alloc picture */
if ( width != s->width || height != s->height