From patchwork Sat Jul 4 12:45:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 20793 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 3850044BDE2 for ; Sat, 4 Jul 2020 15:52:17 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1000268B453; Sat, 4 Jul 2020 15:52:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-3.mx.upcmail.net (vie01a-dmta-pe06-3.mx.upcmail.net [84.116.36.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3589968A4D4 for ; Sat, 4 Jul 2020 15:52:11 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1jrhZG-000AM3-0y for ffmpeg-devel@ffmpeg.org; Sat, 04 Jul 2020 14:46:54 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id rhYIjt3p96Jy6rhYIjXE9e; Sat, 04 Jul 2020 14:45:54 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=GKl27dFK c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=xA8SVfg_ud3sl33kahMA:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 4 Jul 2020 14:45:53 +0200 Message-Id: <20200704124553.28582-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200704124553.28582-1-michael@niedermayer.cc> References: <20200704124553.28582-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfOMx20kauvl9Obav8lwwe8Qr+n7Cz1GN445gS3+3nOZV9Kba7Cbb0+a7NuGHfhIKLLj/GGnFTN0cbbwIZ024FuWXeO+GetxlYT2LfAqa9ZkhcGhtGaAz fhMNdOEGncoSo4WI0JOjCSxO+/ODu+vGx7ygUb61hNqzsrXugPe5VXeV Subject: [FFmpeg-devel] [PATCH 3/3] avcodec: attempt to fix wrong pixel format for DNG X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 --- libavcodec/mjpegdec.c | 2 +- libavcodec/tiff.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 &&