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 96F0240A8E for ; Sun, 26 Dec 2021 08:50:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F242568B0C4; Sun, 26 Dec 2021 10:50:32 +0200 (EET) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0E6AC68AF73 for ; Sun, 26 Dec 2021 10:50:26 +0200 (EET) Received: by mail-yb1-f176.google.com with SMTP id m19so18078645ybf.9 for ; Sun, 26 Dec 2021 00:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=gIbcweK1dXiw/aKtj+drucKCOPz+wiv7DVwjL49dZNQ=; b=RW0basGuSBTvoa7cXq1NAqnASKY6DZoBNHE2X9uEEBinLQQa3RR9ooiGwseQEnxkTr GHKRUj4VgdPU7LR4bEKk57gtyIwRmHAsGlRid/k7tGV2kKNkLsAU0Y3ACxQfnFk58n1Y WmVKEyr2kWJv2WeH5KFBr2ChPoJDbj46sYQsjO+mimDaw79IKEIMhMM+zCCwMIjKL3Gv jnby/mHf6LPbOuNGmeKvCW6yM+ZuYOAJGWG0tysW2tmTS0TcYVFUYvwvZeb1+VsQFik+ 2lDTxCw9dRrDQSy71ti91P9saL9IUr1AlfPxIaWR1/WVCarw5F+R+pXRVgAAZB0GFKoi ZtBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=gIbcweK1dXiw/aKtj+drucKCOPz+wiv7DVwjL49dZNQ=; b=xVXEABVpPLKnWNJDn9ZrLqqqe8rSuzU9rQ6e5x6VRGkSr9oXav/bvkLp396g41GPHK Jt2JbxaiNnwE+Hap7xxBHg8t9LUpqwoQOJ/ZjfljpRJE2SQnFeE+/yUva2nBUzr5zR2R EB1PwInaJbzMjWQevJcRTtOYiUOMnZEZN6DF4Gnm6NUYswrYdKkmNL2TtRL7YbYA9I/Q YZ6VIfiQFToFO+BPJQzsDPCFhjjTs0ccLOJq7q7Lar4dtDVjriTrigT+ECRNDG0OhuqM DCWsD4Amlzey67Wp16MoeWnMyJ9uL8V5PVuZVSzj1L+yhs3WdC9fNkiY1wtkBgHCJKUo iOQQ== X-Gm-Message-State: AOAM533QVOPRJZ8NuL+uiIkos+DE16t1VvPkATjW/w2MK1PLudDelpCI Q3rw4LKLkIJHfz6eKRFytoKbAZdspLUo99OhxbbLy/hz X-Google-Smtp-Source: ABdhPJyoqMUkVOBur9PYJ9xxes2fgkCK8DhZtN88S3/El84q0ZJBsVGMKgNkiLtyru3kZmOdAO125jKCSRfZ/Uoe1jE= X-Received: by 2002:a05:6902:1501:: with SMTP id q1mr19020562ybu.580.1640508624129; Sun, 26 Dec 2021 00:50:24 -0800 (PST) MIME-Version: 1.0 References: <20211225224213.9698-1-michael@niedermayer.cc> In-Reply-To: <20211225224213.9698-1-michael@niedermayer.cc> From: Paul B Mahol Date: Sun, 26 Dec 2021 09:50:28 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] avcodec/tiff: Remove messing with jpeg context 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 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: Please confirm you are not breaking tile files in any way. On Sat, Dec 25, 2021 at 11:43 PM Michael Niedermayer wrote: > The whole concept is just not correct, also as it seems not to be needed > at all, all dng files i have decode without this. > > Fixes: various crashes > Fixes: > 42937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4625073334517760 > Fixes: > 42938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4643368217477120 > Fixes: > 42939/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4925325908246528 > Fixes: > 42940/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4925378806808576 > Fixes: > 42941/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6202009265504256 > Fixes: > 42944/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6076860998483968 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by > : > Michael Niedermayer > --- > libavcodec/tiff.c | 24 ++---------------------- > 1 file changed, 2 insertions(+), 22 deletions(-) > > diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c > index 60773d59ed0..fd85d104dc4 100644 > --- a/libavcodec/tiff.c > +++ b/libavcodec/tiff.c > @@ -721,20 +721,6 @@ static int dng_decode_jpeg(AVCodecContext *avctx, > AVFrame *frame, > return 0; > } > > -static int dng_decode_strip(AVCodecContext *avctx, AVFrame *frame) > -{ > - TiffContext *s = avctx->priv_data; > - int ret = ff_set_dimensions(s->avctx_mjpeg, s->width, s->height); > - > - if (ret < 0) > - return ret; > - > - s->jpgframe->width = s->width; > - s->jpgframe->height = s->height; > - > - return dng_decode_jpeg(avctx, frame, s->stripsize, 0, 0, s->width, > s->height); > -} > - > static int tiff_unpack_strip(TiffContext *s, AVFrame *p, uint8_t *dst, > int stride, > const uint8_t *src, int size, int > strip_start, int lines) > { > @@ -856,7 +842,7 @@ static int tiff_unpack_strip(TiffContext *s, AVFrame > *p, uint8_t *dst, int strid > av_log(s->avctx, AV_LOG_ERROR, "More than one DNG JPEG strips > unsupported\n"); > return AVERROR_PATCHWELCOME; > } > - if ((ret = dng_decode_strip(s->avctx, p)) < 0) > + if ((ret = dng_decode_jpeg(s->avctx, p, s->stripsize, 0, 0, > s->width, s->height)) < 0) > return ret; > return 0; > } > @@ -972,13 +958,7 @@ static int dng_decode_tiles(AVCodecContext *avctx, > AVFrame *frame, > int has_width_leftover, has_height_leftover; > int tile_x = 0, tile_y = 0; > int pos_x = 0, pos_y = 0; > - int ret = ff_set_dimensions(s->avctx_mjpeg, s->tile_width, > s->tile_length); > - > - if (ret < 0) > - return ret; > - > - s->jpgframe->width = s->tile_width; > - s->jpgframe->height = s->tile_length; > + int ret; > > has_width_leftover = (s->width % s->tile_width != 0); > has_height_leftover = (s->height % s->tile_length != 0); > -- > 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". > _______________________________________________ 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".