From patchwork Thu Feb 16 13:16:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 2574 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp2467576vsb; Thu, 16 Feb 2017 05:16:43 -0800 (PST) X-Received: by 10.28.65.196 with SMTP id o187mr11796348wma.37.1487251003813; Thu, 16 Feb 2017 05:16:43 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x84si588207wmg.38.2017.02.16.05.16.43; Thu, 16 Feb 2017 05:16:43 -0800 (PST) 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 12B4B689A61; Thu, 16 Feb 2017 15:16:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-2.mx.upcmail.net (vie01a-qmta-pe01-2.mx.upcmail.net [62.179.121.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F38D7680A6C for ; Thu, 16 Feb 2017 15:16:28 +0200 (EET) Received: from [172.31.218.39] (helo=vie01a-dmta-pe03-3.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1ceLvG-0004oF-Qa for ffmpeg-devel@ffmpeg.org; Thu, 16 Feb 2017 14:16:34 +0100 Received: from [172.31.216.44] (helo=vie01a-pemc-psmtp-pe02) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1ceLvA-0003SC-VH for ffmpeg-devel@ffmpeg.org; Thu, 16 Feb 2017 14:16:28 +0100 Received: from [192.168.1.3] ([80.110.111.220]) by vie01a-pemc-psmtp-pe02 with SMTP @ mailcloud.upcmail.net id lRGM1u03m4lMiqw01RGNcb; Thu, 16 Feb 2017 14:16:22 +0100 X-SourceIP: 80.110.111.220 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Thu, 16 Feb 2017 14:16:21 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201702161416.21723.cehoyos@ag.or.at> Subject: [FFmpeg-devel] [PATCH]lavf/riff: Support decoding files with broken mediasubtype base guid 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! Attached patch by Thierry fixes ticket #6100, the broken software writing such files was fixed according to the reporter, no effect on written files. Please comment, Carl Eugen From 3c409a0c633fcee5093f026b0ff786a87d9a7989 Mon Sep 17 00:00:00 2001 From: Thierry Foucu Date: Thu, 16 Feb 2017 14:03:38 +0100 Subject: [PATCH] lavf/riff: Support decoding files with broken mediasubtype base guid. Fixes ticket #6100. --- libavformat/riff.h | 2 ++ libavformat/riffdec.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libavformat/riff.h b/libavformat/riff.h index fe87e81..d30d793 100644 --- a/libavformat/riff.h +++ b/libavformat/riff.h @@ -109,6 +109,8 @@ extern const AVCodecGuid ff_codec_wav_guids[]; 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 #define FF_AMBISONIC_BASE_GUID \ 0x21, 0x07, 0xD3, 0x11, 0x86, 0x44, 0xC8, 0xC1, 0xCA, 0x00, 0x00, 0x00 +#define FF_BROKEN_BASE_GUID \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA static av_always_inline int ff_guidcmp(const void *g1, const void *g2) { diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index 42d9b4a..656a9eb 100644 --- a/libavformat/riffdec.c +++ b/libavformat/riffdec.c @@ -72,6 +72,8 @@ static void parse_waveformatex(AVIOContext *pb, AVCodecParameters *par) if (!memcmp(subformat + 4, (const uint8_t[]){ FF_AMBISONIC_BASE_GUID }, 12) || !memcmp(subformat + 4, + (const uint8_t[]){ FF_BROKEN_BASE_GUID }, 12) || + !memcmp(subformat + 4, (const uint8_t[]){ FF_MEDIASUBTYPE_BASE_GUID }, 12)) { par->codec_tag = AV_RL32(subformat); par->codec_id = ff_wav_codec_get_id(par->codec_tag,