Commit 4ade824e authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 73abc3a6
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment