diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-27 23:45:44 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-27 23:47:23 +0100 |
commit | 4ade824e1f6a27f2357098d8e7e615f1b524a588 (patch) | |
tree | 92830736d401a819a3a1fed003107b1de5612751 | |
parent | 73abc3a634d84e4cc8951787323b594c5476e4a8 (diff) | |
download | ffmpeg-4ade824e1f6a27f2357098d8e7e615f1b524a588.tar.gz |
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>
-rw-r--r-- | libavcodec/mjpegdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index fc428df241..299c0817ec 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -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 |