From patchwork Sat May 12 16:33:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 8929 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp2130864jad; Sat, 12 May 2018 09:35:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrs30fcuBo1ATXK+ZpD4vgoOMR/mT0QixmakIAcgs8MMBbqTW1GMHYFoyNaVQllyp7+nXPO X-Received: by 2002:adf:abab:: with SMTP id s40-v6mr2560078wrc.259.1526142935958; Sat, 12 May 2018 09:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526142935; cv=none; d=google.com; s=arc-20160816; b=aBzCP33huQCV449fx47QPlylX0mSSPhSrVGxlxsBSAfn+KV+UDOyOsJaAVF2o0mv4j 3PDOGa/QbADWpZk1ogndq0s/dvBdLsiMH+HMGutilnJbx/0ERBlAf43h1asvlYbt43B/ 9GIwhu4T2Njn9jJ4SHE92hVF5e9HwVb4bflJB7+yqQdzKptDif7aodDjbvvFo0btuksN 2vXuN1ieCT0pyQHjhFJOTIU+H7U/xJRPX8UDjQylXLlA3VjzqoGL8hKDRd5UUja+GAhm QpJskG3f60XxTNc5lcIYEYurwom9cCYCXVMbWnzTnjLYvJKZjYZqA1J7acKQVGWLeLls peFw== 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:arc-authentication-results; bh=z8MaCb7g50bketRD+rF202i9iwYkHkgNSYMkpmoCafM=; b=gocDxtM6yP4zK8NYS8CYq5VuyxwLtBb1C79Z7bCoiHs2J5YiSqkj7Emee+Rkp1FrMr 0cdFzKIOB80dAY9Ql+WmWzMwDeh7uAX+07lWlMrMRbAYqyh5xCSQKQDOwgija3X8gGoz tnTa3t8WjD6aBDn1pmyN8JciR4ygZLNvV9VMI8xZK8jEIClF3jsNgIQiopkvjwGwJWBp 29cgmfRJBNWuSQfILikUocfCCQR5VoZ5C/QaQCHITIroaxzTQx0T2wxfL+orIEIf8Kqm /vXS/XTL4LTjBqBN3FfR6PKwmIOm81fAQg1JFhD+yiKQXIvoV3QryHzUnPcJR3Y9ZQzG GU4w== 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 41-v6si5198462wrz.0.2018.05.12.09.35.34; Sat, 12 May 2018 09:35:35 -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 6D0AC68A8BF; Sat, 12 May 2018 19:34:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-3.mx.upcmail.net (vie01a-qmta-pe01-3.mx.upcmail.net [62.179.121.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BAD7968A61E for ; Sat, 12 May 2018 19:34:31 +0300 (EEST) Received: from [172.31.218.50] (helo=vie01a-dmta-pe07-2.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fHXUC-0000qE-H4 for ffmpeg-devel@ffmpeg.org; Sat, 12 May 2018 18:35:08 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fHXU7-0004Gf-5P for ffmpeg-devel@ffmpeg.org; Sat, 12 May 2018 18:35:03 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id lUay1x00A0S5wYM01UazdA; Sat, 12 May 2018 18:34:59 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 12 May 2018 18:33:28 +0200 Message-Id: <20180512163329.18380-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512163329.18380-1-michael@niedermayer.cc> References: <20180512163329.18380-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 4/5] avformat/mp3dec: Require 50% of the file to be mp3 frames in the maxframes>200 probing test X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" This corrects several misdetections of large files Signed-off-by: Michael Niedermayer --- libavformat/mp3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index a26714ebaf..d419f8c9fe 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -107,7 +107,7 @@ static int mp3_read_probe(AVProbeData *p) // keep this in sync with ac3 probe, both need to avoid // issues with MPEG-files! if (first_frames>=7) return AVPROBE_SCORE_EXTENSION + 1; - else if(max_frames>200)return AVPROBE_SCORE_EXTENSION; + else if(max_frames>200 && p->buf_size < 2*max_framesizes)return AVPROBE_SCORE_EXTENSION; else if(max_frames>=4 && p->buf_size < 2*max_framesizes) return AVPROBE_SCORE_EXTENSION / 2; else if(ff_id3v2_match(buf0, ID3v2_DEFAULT_MAGIC) && 2*ff_id3v2_tag_len(buf0) >= p->buf_size) return p->buf_size < PROBE_BUF_MAX ? AVPROBE_SCORE_EXTENSION / 4 : AVPROBE_SCORE_EXTENSION - 2;