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 6AF6642533 for ; Wed, 5 Jan 2022 01:38:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 26A0A68A7FD; Wed, 5 Jan 2022 03:38:57 +0200 (EET) Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4DC3C68A7ED for ; Wed, 5 Jan 2022 03:38:50 +0200 (EET) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zanevaniperen.com; s=key1; t=1641346729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M/jKevqkhtcTtue9i99Um7H9rGzgIrAjs4faruAyuHw=; b=JqsTjR4V9YcUaWq90F9IKDuRXt9aVpeqnjBtCPSmIRKc46owA/SIHzJqdk3GfnVpoFZveE EbSKdUf9ttEE3X3Q9lINQ0i71W/eVbfUSPZ3M8jWu0PjF9JDrPsikfSsTHmjcsBseuPbJQ v+5SQjQ6wvrPy5llwLP8FQYbCi6oiE9Sn5GKIkZMFUX3tHEY6Ml9fH5qaTyvCxEqnH2Ell /oVnwvCVXiBcCquiddtZNMqk6CtUsnGyxQo8BpAfVJDYS6O5oxqS3hQKVxQYvlp8gaMo17 rnmfMRAfUbx/bFOYBDvJtSwA3K9LQ3qv8AP6NezKpAV9ULtIrw5Mn2pRUYY/9A== Date: Wed, 5 Jan 2022 11:38:45 +1000 MIME-Version: 1.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220103155919.12015-1-pal@sandflow.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Zane van Iperen In-Reply-To: <20220103155919.12015-1-pal@sandflow.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: zanevaniperen.com Subject: Re: [FFmpeg-devel] [PATCH v1] avformat/imf: fix bad free() when directory name of the input url is empty 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/22 01:59, pal@sandflow.com wrote: > From: Pierre-Anthony Lemieux > > Signed-off-by: Pierre-Anthony Lemieux > --- > > Notes: > Found through manual fuzzing. > > libavformat/imfdec.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c > index f17064cfcd..4e42db8d30 100644 > --- a/libavformat/imfdec.c > +++ b/libavformat/imfdec.c > @@ -622,11 +622,15 @@ static int imf_read_header(AVFormatContext *s) > int ret = 0; > > c->interrupt_callback = &s->interrupt_callback; > + > tmp_str = av_strdup(s->url); > if (!tmp_str) > return AVERROR(ENOMEM); > + c->base_url = av_strdup(av_dirname(tmp_str)); Is the second av_strdup() here required? You've already done it above and av_dirname() just sticks a '\0' at the last separator, so it should be safe to remove it: if (!(c->base_url = av_strdup(s->url))) return AVERROR(ENOMEM); c->base_url = av_dirname(c->base_url); _______________________________________________ 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".