From patchwork Fri Oct 2 05:53:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liushuyu@aosc.io X-Patchwork-Id: 22681 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 1BD7444BA68 for ; Fri, 2 Oct 2020 08:54:21 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 035C7689EEC; Fri, 2 Oct 2020 08:54:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2.mymailcheap.com (relay2.mymailcheap.com [217.182.113.132]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E59FE689C6C for ; Fri, 2 Oct 2020 08:54:12 +0300 (EEST) Received: from filter2.mymailcheap.com (filter2.mymailcheap.com [91.134.140.82]) by relay2.mymailcheap.com (Postfix) with ESMTPS id 0D9B63ECDA for ; Fri, 2 Oct 2020 07:54:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by filter2.mymailcheap.com (Postfix) with ESMTP id DED382A911 for ; Fri, 2 Oct 2020 07:54:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mymailcheap.com; s=default; t=1601618051; bh=aauieCM/tF5/vZDtTugczFKiOszKXUzSdjGcRMwcbxw=; h=From:To:Cc:Subject:Date:From; b=ng+4cdy5hNgLPjaP2xIxXkWuaevPlAysMK6/2/ZXU953CQzDPVqACVkwT7dbiuskF gsiBeKwGN3BoXqMUxe85yRgFmzh//XlOjQy2Xg5WOmS9GASdTlFt/aRDajpFndPMU/ RzPNCBlI/QK+YDVIfGOY5qE7SPtTjOEpi4WWmVRs= X-Virus-Scanned: Debian amavisd-new at filter2.mymailcheap.com Received: from filter2.mymailcheap.com ([127.0.0.1]) by localhost (filter2.mymailcheap.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nArK_wwjCnx0 for ; Fri, 2 Oct 2020 07:54:10 +0200 (CEST) Received: from mail20.mymailcheap.com (mail20.mymailcheap.com [51.83.111.147]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by filter2.mymailcheap.com (Postfix) with ESMTPS for ; Fri, 2 Oct 2020 07:54:10 +0200 (CEST) Received: from [213.133.102.83] (ml.mymailcheap.com [213.133.102.83]) by mail20.mymailcheap.com (Postfix) with ESMTP id C308241CAC; Fri, 2 Oct 2020 05:54:09 +0000 (UTC) Authentication-Results: mail20.mymailcheap.com; dkim=pass (1024-bit key; unprotected) header.d=aosc.io header.i=@aosc.io header.b="PqIxolx4"; dkim-atps=neutral AI-Spam-Status: Not processed Received: from liushuyu.lan (d50-99-10-89.abhsia.telus.net [50.99.10.89]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail20.mymailcheap.com (Postfix) with ESMTPSA id B68D141CAC; Fri, 2 Oct 2020 05:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aosc.io; s=default; t=1601618042; bh=aauieCM/tF5/vZDtTugczFKiOszKXUzSdjGcRMwcbxw=; h=From:To:Cc:Subject:Date:From; b=PqIxolx4ZLF60ermqENynrsLryU2Oua4z/r4T1G1MxD2/bvHGbOC38xU8GjIDBU3w /TFp2PSD2w6l0Ai1x2ju/PLhcw5xxLkz42jc/Lv6Jc1qHWHaeJqRQwV94kpeAlfc+F QEIDCItbHlh9c8zjaJ+h27GGtoXheq9qdwwaUm6Q= From: liushuyu@aosc.io To: ffmpeg-devel@ffmpeg.org Date: Thu, 1 Oct 2020 23:53:35 -0600 Message-Id: <20201002055336.38476-1-liushuyu@aosc.io> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: C308241CAC X-Spamd-Result: default: False [4.90 / 20.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(0.00)[aosc.io:s=default]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[aosc.io]; BROKEN_CONTENT_TYPE(1.50)[]; R_SPF_SOFTFAIL(0.00)[~all]; ML_SERVERS(-3.10)[213.133.102.83]; DKIM_TRACE(0.00)[aosc.io:+]; RCPT_COUNT_TWO(0.00)[2]; FROM_NO_DN(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:213.133.96.0/19, country:DE]; RCVD_COUNT_TWO(0.00)[2]; HFILTER_HELO_BAREIP(3.00)[213.133.102.83,1] X-Rspamd-Server: mail20.mymailcheap.com Subject: [FFmpeg-devel] [PATCH 0/1] avformat: mca: relax a condition check to be able to play 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 Cc: liushuyu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: liushuyu In certain mca files, the coefficient table is in the data section instead of the header section. In this case, the coefficient offset relative to the header ending marker is a negative value thus failing the original condition check at line 146. The new check just check if the coefficient offset is within the file range (since there is no way to know where the actual audio samples are without the correct header information). I have also prepared some sample files for you to test: (Coefficient in data section) https://streams.videolan.org/ffmpeg/incoming/bgm_pot_metal_a1_a_1632.mca And at last, I found some old samples that uses older MCA container format: (MCA Version 3) https://streams.videolan.org/ffmpeg/incoming/s_bgm_4b_DownMix.mca liushuyu (1): avformat: mca: relax a condition check to be able to play certain files libavformat/mca.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)