From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id C09304449D for ; Mon, 12 Sep 2022 18:19:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7D32F68BAE4; Mon, 12 Sep 2022 21:19:28 +0300 (EEST) Received: from vie01a-dmta-at01-1.mx.upcmail.net (vie01a-dmta-at01-1.mx.upcmail.net [62.179.121.145]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4C06A68B6F7 for ; Mon, 12 Sep 2022 21:19:21 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at01.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1oXo1f-008CaZ-Tf for ffmpeg-devel@ffmpeg.org; Mon, 12 Sep 2022 20:19:19 +0200 Received: from ren-mail-psmtp-mg01. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id Xo1dosZdc8s8UXo1fouFKj; Mon, 12 Sep 2022 20:19:19 +0200 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg01. with ESMTP id Xo1eoUVzzOPqFXo1eo9vMS; Mon, 12 Sep 2022 20:19:19 +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.4 cv=OcX7sjfY c=1 sm=1 tr=0 ts=631f7827 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=HrSBPqDXTuV1ja4k2j8A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 12 Sep 2022 20:19:18 +0200 Message-Id: <20220912181918.9699-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfK4Klhd9rYVK5gEKW5Y2Tz9/SenDk5fiHuRrqSFxv83STIQO8eplmB5xzf23jmjw9Bnl7NLVu0Eu1TFsv3tot/F6RExg3K3bOHML9T0cstRb9nWiyazf Lfv/hXgp10Ee5D7VqbFun3QLgU5t3EALPqURBBnO7CJCz9b8BZVh1BYwFvPqzociTusZiQe85t9TLw== Subject: [FFmpeg-devel] [PATCH] avcodec/tiff: Fix loop detection X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes regression with tickets/4364/L1004220.DNG Signed-off-by: Michael Niedermayer --- libavcodec/tiff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index beb427e0074..226050744fc 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1747,7 +1747,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { TiffContext *const s = avctx->priv_data; - unsigned off, last_off; + unsigned off, last_off = 0; int le, ret, plane, planes; int i, j, entries, stride; unsigned soff, ssize; @@ -1812,7 +1812,6 @@ again: /** whether we should process this multi-page IFD's next page */ retry_for_page = s->get_page && s->cur_page + 1 < s->get_page; // get_page is 1-indexed - last_off = off; if (retry_for_page) { // set offset to the next IFD off = ff_tget_long(&s->gb, le); @@ -1830,6 +1829,7 @@ again: avpriv_request_sample(s->avctx, "non increasing IFD offset"); return AVERROR_INVALIDDATA; } + last_off = off; if (off >= UINT_MAX - 14 || avpkt->size < off + 14) { av_log(avctx, AV_LOG_ERROR, "IFD offset is greater than image size\n"); return AVERROR_INVALIDDATA; -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".