diff mbox series

[FFmpeg-devel,1/3] avcodec/mjpegdec: Limit bayer to single plane outputting format

Message ID 20200704124553.28582-1-michael@niedermayer.cc
State Accepted
Commit 865a34970e73b9c23e33fd6dc6ba046d4e821519
Headers show
Series [FFmpeg-devel,1/3] avcodec/mjpegdec: Limit bayer to single plane outputting format
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Michael Niedermayer July 4, 2020, 12:45 p.m. UTC
This reduces the number of paths reachable with DNG and should
improve security

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/mjpegdec.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Michael Niedermayer July 5, 2020, 10:38 p.m. UTC | #1
On Sat, Jul 04, 2020 at 02:45:51PM +0200, Michael Niedermayer wrote:
> This reduces the number of paths reachable with DNG and should
> improve security
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/mjpegdec.c | 5 +++++
>  1 file changed, 5 insertions(+)

will apply

[...]
diff mbox series

Patch

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index cb5e2a9b9b..e7a4e08c1c 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -499,6 +499,11 @@  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
             }
         }
 
+        if (s->bayer) {
+            if (pix_fmt_id != 0x11110000 && pix_fmt_id != 0x11000000)
+                goto unk_pixfmt;
+        }
+
         switch (pix_fmt_id) {
         case 0x11110000: /* for bayer-encoded huffman lossless JPEGs embedded in DNGs */
             if (!s->bayer)