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 89C234A610 for ; Mon, 1 Apr 2024 21:54:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7899F68CF50; Tue, 2 Apr 2024 00:54:33 +0300 (EEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 498B468CC9F for ; Tue, 2 Apr 2024 00:54:27 +0300 (EEST) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1e2232e30f4so31948475ad.2 for ; Mon, 01 Apr 2024 14:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712008464; x=1712613264; 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=YBl4UV6oPUVyKxxy3+nDq7AkLCc2QX2V4lFE7Pzgjkg=; b=Oqpsq8sSS3+DfW9KI+zNdYSiiCN854nPh5yiBE3vKH959A/Xh+acvBwzgGE40/5JCf CDdLJL8X8pQjiuakbYFMcBcKBAxamfMB1Y6kSP+q0RbABEnJk9k6D2MEiaZFWRjVPNtK OS9zM6BxT1jgsVs89lN/HRiU6nVsDSikndNzoZy/VFSQRcO+chjeVgsfifs7kZj6MbNJ PTGHaOnFPE9RQ45jn/hw9L0HLo90OB1jp77iKqygf64714zcSMD7UlsJn2NacIvJ+1uw 5qvTkeMPGoZaZSvlg5psHREjPADTmDNnwQo5fKBoP/PL3gnYIoiQ+I1FkD9y9fvSbL4b Rn4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712008464; x=1712613264; 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=YBl4UV6oPUVyKxxy3+nDq7AkLCc2QX2V4lFE7Pzgjkg=; b=gJMGACG6jLuYMgFGuvEqaFm5Y+KRFQFIBkxH0Ui1zDzKAf07HZmEtkNSqLc5mj/iB0 bgOj8VBhQr+u4Dix8e3rBbGK70i3lTCT+Zl4aBjh5SUbV3ZFsiu/KnYRBoj2NrnkqD9x 1GM83/lWmL0QZyS2rpBZKe5N/uqcD4l00NUcfpkb6/7zjWwYGowyf8awj/cTR+RxRlD6 Yd9cUE6Unkk/gQ+bx5nzR+ZvSR8N3pbgG5j9LefhUZ6GI8Sblwo8KKR94E6IeNUV3veE auxDxzErVvVqcosI9BQVgqJAQOiFBpvooOwATCQc4/kvGjcpB2UmD4IxFM4CK4HPqPCU ZrcA== X-Gm-Message-State: AOJu0YzvLkquUOTtkWNBQhS1hw8gdoRR/VlNtqwjPo9DvQIZsVD7J4bd 6lkBI4ibR/+/yfHPZdXJz7HsoW6612Cczl2HueXCy3lSHq9Zb9N9toK9QXk+ X-Google-Smtp-Source: AGHT+IHC9+ixPZbbje52YY1WCXQL/c5xzVjMtdAz9NoAkA3YcuuArjzzd3CGQXF47il3FlamrdiuZg== X-Received: by 2002:a17:902:e549:b0:1e0:a7b1:ee92 with SMTP id n9-20020a170902e54900b001e0a7b1ee92mr11288048plf.62.1712008464377; Mon, 01 Apr 2024 14:54:24 -0700 (PDT) Received: from [192.168.0.15] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id u12-20020a17090341cc00b001dd6f1516a0sm9493025ple.87.2024.04.01.14.54.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Apr 2024 14:54:24 -0700 (PDT) Message-ID: <2d71814b-0e2a-4131-836a-c054c2b71fd7@gmail.com> Date: Mon, 1 Apr 2024 18:54:35 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240401205607.9093-1-michael@niedermayer.cc> <20240401205607.9093-2-michael@niedermayer.cc> Content-Language: en-US From: James Almer In-Reply-To: <20240401205607.9093-2-michael@niedermayer.cc> Subject: Re: [FFmpeg-devel] [PATCH 2/6] avformat/mov: Check that tile_item_list is initialized in read_image_iovl() 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/1/2024 5:56 PM, Michael Niedermayer wrote: > Fixes: null pointer dereference > Fixes: 67494/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6528714521247744 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavformat/mov.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/libavformat/mov.c b/libavformat/mov.c > index 7bdeeb99f98..fa4c237c0d8 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -9364,6 +9364,10 @@ static int read_image_iovl(AVFormatContext *s, const HEIFGrid *grid, > } > > for (int i = 0; i < tile_grid->nb_tiles; i++) { > + if (!grid->tile_item_list[i]) { > + ret = AVERROR_INVALIDDATA; > + goto fail; > + } This should not happen. We shouldn't get this far if the array was not filled. Can you please test the following? > diff --git a/libavformat/mov.c b/libavformat/mov.c > index 7bdeeb99f9..fb0113b149 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -9397,8 +9397,9 @@ static int mov_parse_tiles(AVFormatContext *s) > > for (int j = 0; j < grid->nb_tiles; j++) { > int tile_id = grid->tile_id_list[j]; > + int k; > > - for (int k = 0; k < mov->nb_heif_item; k++) { > + for (k = 0; k < mov->nb_heif_item; k++) { > HEIFItem *item = &mov->heif_item[k]; > AVStream *st = item->st; > > @@ -9424,6 +9425,13 @@ static int mov_parse_tiles(AVFormatContext *s) > break; > } > > + if (k == grid->nb_tiles) { > + 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); > + ff_remove_stream_group(s, stg); > + loop = 0; > + } > if (!loop) > break; > } _______________________________________________ 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".