From patchwork Sat May 6 13:25:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 41508 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp1155686pzb; Sat, 6 May 2023 06:25:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6HKeZEUx1Z68k+AitnQnZvnch+0SLUtTSI1gJ31UTa4FztE+s2KJDPpCCnSOqh88S4waDe X-Received: by 2002:a05:6402:742:b0:50d:89d5:bf95 with SMTP id p2-20020a056402074200b0050d89d5bf95mr1599970edy.20.1683379525184; Sat, 06 May 2023 06:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683379525; cv=none; d=google.com; s=arc-20160816; b=N981x9+HL4Q7EPgkfmg1kBdjJ2eP3us+7r+rWzCpNtCmJxeXAfK/I8Q3oWufO96457 sjGyRh1fnpuaSVFNrh1WPdbYPqeJSf9IRzz3YxEVhKlN3Ksm3wcz6zqKAS6+j7lDP1L2 jeYNignMKKiNfZE06thCZWQViya57rWn5sX45Sq4ng2YwKZ4dfDw4LZaM7jPkaFR+uAK VBcokfrjwyqOvcOkI5LOtlNvNnc0D7aSbhxjIPI9qNqxGxKqZpvaw5MuhNdFvKwV1upb ejU4o9Q3fnl5DsaVsKvq1APZgqsvLTGTtoc2uG4qrvvnFNRa50iWtmUxagBoMCiktCxE 2EKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=IB/DwGcqeUUrtnPbmjNbNQhtUQ469xlTqHf5tM+rbuo=; b=fpacv9RsIyEoEsKLzSZfaoX2GPSVsdKmVYig1CkvAS8Ih1OwQywCiBtFWzxjS9Udmo 7463BtY4khVz4V5kTJ4wxkItthla4vo0N1GdippaGCpt+Df2FGoCmRrmekc/ssNQQk3w dae/gZ6jO/2b0k4cbNwIPatUiC327xTVMX/3LoQuP8FqVqBAzlNbrPq/dKDfM8PuYz7t KZAWPdBBJ6C9ppvoB1RVeYqladNhagXRUjdymbUHtzE3AW+/QpTE74Q1eD0RDl7AY8NL VEqlnMFUy3bjcOZOzPGqdTH24uSxUWBB1RhGBRqzaFsjqITGY+V5Sqyw/Owi0yWs/QVo MyOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d11-20020a50fe8b000000b0050bc7b1ef4csi5842190edt.220.2023.05.06.06.25.24; Sat, 06 May 2023 06:25:25 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 292E1680088; Sat, 6 May 2023 16:25:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9BBC268C089 for ; Sat, 6 May 2023 16:25:05 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 07ABC240003 for ; Sat, 6 May 2023 13:25:04 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 6 May 2023 15:25:02 +0200 Message-Id: <20230506132503.9524-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230506132503.9524-1-michael@niedermayer.cc> References: <20230506132503.9524-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/3] avformat/imfdec: fail on probing non xml file extension 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: fhUlbdx+TWVu Its unexpected that a .avi or other "standard" file turns into a playlist. The goal of this patch is to avoid this unexpected behavior and possible privacy or security differences. This is similar to the same change to hls Signed-off-by: Michael Niedermayer --- libavformat/imfdec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 7d04d0d853..eafe9a6a26 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -926,6 +926,11 @@ static int imf_probe(const AVProbeData *p) if (!strstr(p->buf, "ContentTitle>")) return 0; + if (!av_match_ext(p->filename, "xml")) { + av_log(NULL, AV_LOG_ERROR, "Not detecting imf with non standard extension\n"); + return 0; + } + return AVPROBE_SCORE_MAX; }