diff mbox series

[FFmpeg-devel,3/3] avcodec: attempt to fix wrong pixel format for DNG

Message ID 20200704124553.28582-3-michael@niedermayer.cc
State New
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 is just found by reading the code, I have not found a valid
file using this codepath so its untested.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/mjpegdec.c | 2 +-
 libavcodec/tiff.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index e7a4e08c1c..c2b344371e 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -508,7 +508,7 @@  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
         case 0x11110000: /* for bayer-encoded huffman lossless JPEGs embedded in DNGs */
             if (!s->bayer)
                 goto unk_pixfmt;
-            s->avctx->pix_fmt = AV_PIX_FMT_GRAY16LE;
+            s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
             break;
         case 0x11111100:
             if (s->rgb)
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 6a3ec3ef95..9508807b93 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -918,7 +918,7 @@  static int dng_decode_jpeg(AVCodecContext *avctx, AVFrame *frame,
     /* See dng_blit for explanation */
     if (s->avctx_mjpeg->width  == w * 2 &&
         s->avctx_mjpeg->height == h / 2 &&
-        s->avctx_mjpeg->pix_fmt == AV_PIX_FMT_GRAY16LE) {
+        s->avctx_mjpeg->pix_fmt == AV_PIX_FMT_GRAY16) {
         is_single_comp = 1;
     } else if (s->avctx_mjpeg->width  == w &&
                s->avctx_mjpeg->height == h &&