From patchwork Sat May 6 13:25:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 41507 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp1155617pzb; Sat, 6 May 2023 06:25:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7dnioLscOjQa36yb5H8AXop0SoZBgP+eJkgNbJOvPsh00xFwy1coDmu0arpMTj+5Nq/lUX X-Received: by 2002:a17:907:7e91:b0:94e:c40b:71e3 with SMTP id qb17-20020a1709077e9100b0094ec40b71e3mr5087207ejc.5.1683379516144; Sat, 06 May 2023 06:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683379516; cv=none; d=google.com; s=arc-20160816; b=buQKxCU2b5nfJnovkhQtRwwsN6sPvTWvZt1a1C+9nGBdh/DFsS92XqHRSpVpixmK/4 BLNCPbOTAWiBeUBEkuo6MTp6vsZoHDBin4Z1PIq0KDUiPq7hhYiV7luSYgLoBFIrkhbF O+xFMUDUBvCvJx8dn7h+VEp30CxiI+/1YI5iDkTyyvm4AcVKvCRo9ArdeZ0ovros9qPA Yq5naB4FQ3VDm3VxGtzII4+fWaqInAj44HFA7etbWWpZsyd+MZAHFvvF0smiM7G2nDSB kPpTPq35XNKI5SZXjc2s1VFGvzsx4+99k8ow2jL76w7NaMe5iagC8+2VmC8ND+NqzD2s q27A== 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:message-id:date:to:from:delivered-to; bh=tS6g4ajnvj1454TfhQtQ22lCvTyCaqdvF/octH4pSj8=; b=m4hvGLbKdEYfO9oKSLKW5P6C+mduxqfc8OKhhtttT4m4jeitKJqIFYyo3fXPKzARZA w7rgIOgL0lcy54XJmIc9xhu6BhZJePc2n1fAqUR4VQQ3Ps/PTND7rI1HnomGviHs4SJC Vz8VYhhz3dnrj3n+PjK1lGlGWMW9kbw02iv59SNMXC5LYarsZxlmatjnrmB0IHSCpiXQ YCIiwhC2q8fc9VSMRQK63acHT++yqylSzalaZipJC0e3kvcbrshOWEzfgSQYciYSDztO Cec77VY1GOtHDXUkKBrUlRcxIT0yJhtj1/0l/gxk5YDLP/hL3Wt7ZnVOLxUhoZLynt66 +v+w== 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 q18-20020a1709066ad200b009584c5bcbc6si2632866ejs.823.2023.05.06.06.25.14; Sat, 06 May 2023 06:25:16 -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 28E3768C022; Sat, 6 May 2023 16:25:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DAC7D68C022 for ; Sat, 6 May 2023 16:25:04 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 0F072FF809 for ; Sat, 6 May 2023 13:25:03 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 6 May 2023 15:25:01 +0200 Message-Id: <20230506132503.9524-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/3] avformat/dashdec: fail on probing non mpd 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: nyCxzYDfuIFT 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/dashdec.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 29d4680c68..294e14150d 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -2336,10 +2336,13 @@ static int dash_probe(const AVProbeData *p) av_stristr(p->buf, "dash:profile:isoff-live:2011") || av_stristr(p->buf, "dash:profile:isoff-live:2012") || av_stristr(p->buf, "dash:profile:isoff-main:2011") || - av_stristr(p->buf, "3GPP:PSS:profile:DASH1")) { - return AVPROBE_SCORE_MAX; - } - if (av_stristr(p->buf, "dash:profile")) { + av_stristr(p->buf, "3GPP:PSS:profile:DASH1") || + av_stristr(p->buf, "dash:profile")) { + if (!av_match_ext(p->filename, "mpd")) { + av_log(NULL, AV_LOG_ERROR, "Not detecting dash with non standard extension\n"); + return 0; + } + return AVPROBE_SCORE_MAX; }