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 5E21D48D93 for ; Fri, 26 Apr 2024 12:31:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6713F68D432; Fri, 26 Apr 2024 15:31:02 +0300 (EEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1C27568D3C6 for ; Fri, 26 Apr 2024 15:30:56 +0300 (EEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1e8bbcbc2b7so19106295ad.0 for ; Fri, 26 Apr 2024 05:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714134653; x=1714739453; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=MpSBDk5TwQtErCwB6s5dCHrmaEdXl8ALT7s9yywmnNI=; b=imckJ3JyKTLJnP/VCpuWRdKj8ZOFV+wWRfkVpLDfqUW2FoPkrXWIp/FwVjRRfNJ1ev KgI7v9PkyMpcJ9M651LAv+uY8AGp2UqjNJWD6nzjRxvfVG2+5IITxbReNjSUq5Z6F2sQ j+c5fyuFcUMKX06ekHYlzSLuMhcnyEMGQpJMCOi5PO0AP7XaXiBjkUyUx4vV4mZ1UhSK zHnrKTFJyc+eisqdFINZr4NfZWvHIIkOVsHEO1Xob/z4pfGLyp0+W7OoxklM0IdLBDEz zfrMQf4LLZMtxKVned4ksDpbbHnjFK/puCoNhlNl8V1CqIyYmJIxX+i+0TaV5+YrlMcB Pjqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714134653; x=1714739453; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MpSBDk5TwQtErCwB6s5dCHrmaEdXl8ALT7s9yywmnNI=; b=ikTwfDVdYEEKZLknq2YAk3t7hoULX5AY1aNL5ZlpMksvkpUHUUqe2oyiNTSiuC4Wf4 LY+bsPk+m1BVaHDF/umh9XFd5AVfdTdTvRRr7cbQj+WYG/aR3vXKQHsqzoe4duCELczS 9g8+TdwePVaoIXeXYgaAhfI6ow5+L3sSJ3S2GsaVJZddJSjagRnQ22GmtBMOexpbktDT o51xOfb0eifIcTnSlDOuVuPbdxntAUboD6XR4Cfm1it0aoueGSK//zMLy68emYKNBV+u NKuwSdtio7DGyDOgcuqhUW8OH38kqySk5QVPTNagRVOMPwQzCmaNvXewcwByKMcZVRSY VZ0g== X-Gm-Message-State: AOJu0YzTHJC/rE21+iNv9C/HUBTaYV+1JLVTXO1aOc0JhxRSp48rMtDw TvP8IrzOU5s1P3wdKMfGJ932RmXLg3mMPuPs/Yfd5qOVK47GM+ikcr9KlA== X-Google-Smtp-Source: AGHT+IE4Tu2cOcBnCW6ZTPi/0NfryiNRe03Hwc1Pt+fWShjLb468lBLezh7C95lChqXG2zYss35SBA== X-Received: by 2002:a17:902:c94a:b0:1eb:1581:87f3 with SMTP id i10-20020a170902c94a00b001eb158187f3mr1611358pla.7.1714134653391; Fri, 26 Apr 2024 05:30:53 -0700 (PDT) Received: from [192.168.0.10] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id w7-20020a1709029a8700b001e509d4d6ddsm15384186plp.1.2024.04.26.05.30.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 05:30:52 -0700 (PDT) Message-ID: Date: Fri, 26 Apr 2024 09:30:50 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240426030839.3001504-1-michael@niedermayer.cc> Content-Language: en-US From: James Almer In-Reply-To: <20240426030839.3001504-1-michael@niedermayer.cc> Subject: Re: [FFmpeg-devel] [PATCH 1/6] avformat/mov: Check tile_item_list 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 4/26/2024 12:08 AM, Michael Niedermayer wrote: > Fixes: Null pointer dereference > Fixes: 67861/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5352628142800896 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavformat/mov.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libavformat/mov.c b/libavformat/mov.c > index ecd29a7d08b..97a24e6737e 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -9289,6 +9289,9 @@ static int read_image_grid(AVFormatContext *s, const HEIFGrid *grid, > if (tile_grid->nb_tiles != size) > return AVERROR_INVALIDDATA; > > + for (int i = 0; i < size; i++) > + if (!grid->tile_item_list[i]) > + return AVERROR_INVALIDDATA; > for (int i = 0; i < tile_cols; i++) > tile_grid->coded_width += grid->tile_item_list[i]->width; > for (int i = 0; i < size; i += tile_cols) We shouldn't get this far if that's NULL. Does the following also work? > diff --git a/libavformat/mov.c b/libavformat/mov.c > index ecd29a7d08..b21c4b6f3c 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -9440,7 +9440,7 @@ static int mov_parse_tiles(AVFormatContext *s) > break; > } > > - if (k == grid->nb_tiles) { > + if (k == mov->nb_heif_item) { > av_log(s, AV_LOG_WARNING, "HEIF item id %d referenced by grid id %d doesn't " > "exist\n", > tile_id, grid->item->item_id); _______________________________________________ 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".