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 4F3764A2C2 for ; Tue, 26 Mar 2024 01:22:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 051BF68D576; Tue, 26 Mar 2024 03:22:33 +0200 (EET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 548E168D4E7 for ; Tue, 26 Mar 2024 03:22:26 +0200 (EET) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1df01161b39so39067315ad.3 for ; Mon, 25 Mar 2024 18:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711416143; x=1712020943; 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=Lk64jlIjlq5Ff1mNgBFsRl595tRsIACywJYEofsYjYU=; b=Q0ZrVBWnEfC2zMLqxVuqdRz0UPHoV2yIFJIlLK5sTbEEvB5zAihxqNKQCeHmxJ1XnE noGlHd7ewLi36K8JAvGOsIFvxyRfuTL/n2/HAdtPN3VRZNAjx6KaJkQ1lXI9P4uJfFun Y28DLp3cwWAmbY4tryUfQ9wxx6ljekSyCgY8fhm4jVv3n95T2GG4iqkDvZh7aUEO7Ccc EB6jFFxtnboXVq6/oD/4HOD8wMhewftKRURpDkBUVNOgL3Gzul0/Hrlu8Cs24VwTrT6I Ivgi7J9sr4eJ+1diFCYomD0NQKTFosU91J8baMeEBeUuP2GLzI/wywx8vssQ69wkeFuD 3oFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711416143; x=1712020943; 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=Lk64jlIjlq5Ff1mNgBFsRl595tRsIACywJYEofsYjYU=; b=M5JzR/GTxAK2CRPE8gDqNJ3tFxKa6pIEEZBVKoXfkBAAYkLo5q+6Z7BfECiYBjM6Le 5S+o5i64HSYCy0tCBkwu7lvleZIKf/9TUI3OAIBrRRAdE9yFF6u0858oSQrm77VSAwCG QqB12D5MvycEm6kAYhWyi2pq08rn6wPWj+CHS/C8Jiyd/Hyw6X7V5KLu7ammcZOvX+ed e23KI4SjwkQVni4RFch3fmND5YudS+IMPaMGmWU0Ii4+4hgIXJPpMfQ/xXPby4lBayg4 sHzqaA1MKFCk9p+6xtMT1f1/hTrwZM8Xp2moW7BbXxoAHflwMJ1fuLc6ufrci/QzbUYo zcSw== X-Gm-Message-State: AOJu0Yx5pkpzR1uM9LqsF9O3vwTZhdmq8IwXvxnUIPTT4DCqZON+Z5fK AyA74S/GKMWKIZPw0XNtK9oID1//x4D4VDWSxU8kofojXVl/UBFi30kDW7e3 X-Google-Smtp-Source: AGHT+IFgRtyq0dyNQjPtrGoJ4yBzVoMgpJas1qk/odgEwfTKgeDoOGcb3TEHmJnW3izCAsd7syXrCg== X-Received: by 2002:a17:902:db11:b0:1e0:b5d4:9f53 with SMTP id m17-20020a170902db1100b001e0b5d49f53mr7960988plx.7.1711416142763; Mon, 25 Mar 2024 18:22:22 -0700 (PDT) Received: from [192.168.0.15] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id c13-20020a170902b68d00b001dbac604e4dsm5428324pls.146.2024.03.25.18.22.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Mar 2024 18:22:22 -0700 (PDT) Message-ID: Date: Mon, 25 Mar 2024 22:22:19 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240322230818.18997-1-michael@niedermayer.cc> <20240322230818.18997-2-michael@niedermayer.cc> Content-Language: en-US From: James Almer In-Reply-To: <20240322230818.18997-2-michael@niedermayer.cc> Subject: Re: [FFmpeg-devel] [PATCH 2/3] avformat/mov: Do not deallocate heif_item in a input dependant way 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 3/22/2024 8:08 PM, Michael Niedermayer wrote: > Fixes: out of array access > Fixes: 67070/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5685384082161664 > > 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, 2 insertions(+), 2 deletions(-) > > diff --git a/libavformat/mov.c b/libavformat/mov.c > index f954b924a0..a87ce5cefe 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -8077,7 +8077,7 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) > } > item_count = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); > > - heif_item = av_realloc_array(c->heif_item, item_count, sizeof(*c->heif_item)); > + heif_item = av_realloc_array(c->heif_item, FFMAX(item_count, c->nb_heif_item), sizeof(*c->heif_item)); > if (!heif_item) > return AVERROR(ENOMEM); > c->heif_item = heif_item; > @@ -8202,7 +8202,7 @@ static int mov_read_iinf(MOVContext *c, AVIOContext *pb, MOVAtom atom) > avio_rb24(pb); // flags. > entry_count = version ? avio_rb32(pb) : avio_rb16(pb); > > - heif_item = av_realloc_array(c->heif_item, entry_count, sizeof(*c->heif_item)); > + heif_item = av_realloc_array(c->heif_item, FFMAX(entry_count, c->nb_heif_item), sizeof(*c->heif_item)); > if (!heif_item) > return AVERROR(ENOMEM); > c->heif_item = heif_item; LGTM. _______________________________________________ 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".