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 857454111F for ; Mon, 3 Jan 2022 16:00:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4322168B192; Mon, 3 Jan 2022 17:59:59 +0200 (EET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 71407680297 for ; Mon, 3 Jan 2022 17:59:52 +0200 (EET) Received: by mail-pj1-f50.google.com with SMTP id l10-20020a17090a384a00b001b22190e075so32774027pjf.3 for ; Mon, 03 Jan 2022 07:59:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hffl/RjUo9yVFcsZ6wcuW60hNI6ubPNGOXwUDCjN6FU=; b=h7D6LVTYgqOlIqyJLO0R1G14Jz3zaDvan7DGy/JGkVmoJ+q9vqQd7nu72hmLxhyfeY FZhdV4FGBP0lygqMtsl8gLxk5aNHhlgom1mjqeuyelKlLifDUcN82CfYVCNrD5EAphUI VO5HjJi50RbUPLK/enDLrFZZ/RQV0d758jQ17QxM2WSe/Oh3dtRteYrjh+T1ArBSI8ru LOFkso3E2PK5zkZSg+jszBtv9aeAFFZzu/tZ9uVbof/dy8YXw7S4b4kunztZn841Ij6J EFDnB2dr0oDeNU26tpK8PbjdhGh7SMjw5rYmelJ1rERWDgNOQAA1FgLlR1/T5dv6BLFh CyMQ== X-Gm-Message-State: AOAM533i4+y0uO6Ljf03sG2/a1LN+eZPkAtqda+freE/xe+lNTmOi3DF rc2+m1YgBCu5+MAJk+aaZnJO+rjnZew= X-Google-Smtp-Source: ABdhPJz0cpwhOnzTyVujcnx/ThqWusIUe5ApX8VygbgyqvEx/K3CKlqRTy5/rcd5sTzn6rsFaywXmw== X-Received: by 2002:a17:90b:4ad2:: with SMTP id mh18mr55733134pjb.197.1641225590167; Mon, 03 Jan 2022 07:59:50 -0800 (PST) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id g19sm32261189pfv.19.2022.01.03.07.59.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jan 2022 07:59:49 -0800 (PST) Received: by localhost (sSMTP sendmail emulation); Mon, 03 Jan 2022 07:59:29 -0800 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 3 Jan 2022 07:59:19 -0800 Message-Id: <20220103155919.12015-1-pal@sandflow.com> X-Mailer: git-send-email 2.34.1.windows.1 MIME-Version: 1.0 Subject: [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 Cc: Pierre-Anthony Lemieux 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: 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)); + av_freep(&tmp_str); + if (!c->base_url) + return AVERROR(ENOMEM); - c->base_url = av_dirname(tmp_str); if ((ret = ffio_copy_url_options(s->pb, &c->avio_opts)) < 0) return ret; -- 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".