From 83c43e4d52dadc08c38f5f42bf6cdf1e2e72b11c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=96man?= <andreas@olebyn.nu>
Date: Thu, 19 Jul 2007 15:56:56 +0000
Subject: =?UTF-8?q?bail=20out=20on=20unknown=20jpeg=20pixel=20format=20ins?=
 =?UTF-8?q?tead=20of=20silently=20decoding=20data=20incorrectly=20patch=20?=
 =?UTF-8?q?by=20Andreas=20=C3=96man=20%=20andreas=20A=20olebyn=20P=20nu=20?=
 =?UTF-8?q?%=20Original=20thread:=20date:=20Jul=2019,=202007=204:50=20PM?=
 =?UTF-8?q?=20subject:=20[FFmpeg-devel]=20[PATCH]=20bail=20out=20on=20unkn?=
 =?UTF-8?q?own=20jpeg=20pixel=20format?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Originally committed as revision 9764 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavcodec/mjpegdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index d65a3463cf..aa8d2e4f60 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -305,10 +305,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
     case 0x221212:
         s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV422P : PIX_FMT_YUVJ422P;
         break;
-    default:
     case 0x221111:
         s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV420P : PIX_FMT_YUVJ420P;
         break;
+    default:
+        av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id);
+        return -1;
     }
     if(s->ls){
         if(s->nb_components > 1)
-- 
cgit v1.2.3