diff mbox

[FFmpeg-devel] lavf/riff: Support decoding files with broken mediasubtype base guid

Message ID 201702161416.21723.cehoyos@ag.or.at
State Accepted
Commit 4bc7268f2b5fdef03b907279b4e6173cb0e5b835
Headers show

Commit Message

Carl Eugen Hoyos Feb. 16, 2017, 1:16 p.m. UTC
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 <tfoucu@gmail.com>
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(+)

Comments

Michael Niedermayer Feb. 17, 2017, 10:04 a.m. UTC | #1
On Thu, Feb 16, 2017 at 02:16:21PM +0100, Carl Eugen Hoyos wrote:
> 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

>  riff.h    |    2 ++
>  riffdec.c |    2 ++
>  2 files changed, 4 insertions(+)
> 9c34902b6f0c10778b90b4d67cca39319e340a27  0001-lavf-riff-Support-decoding-files-with-broken-mediasu.patch
> From 3c409a0c633fcee5093f026b0ff786a87d9a7989 Mon Sep 17 00:00:00 2001
> From: Thierry Foucu <tfoucu@gmail.com>
> Date: Thu, 16 Feb 2017 14:03:38 +0100
> Subject: [PATCH] lavf/riff: Support decoding files with broken mediasubtype
>  base guid.
> 
> Fixes ticket #6100.

should be ok

[...]

thx
Carl Eugen Hoyos Feb. 17, 2017, 2:58 p.m. UTC | #2
2017-02-17 11:04 GMT+01:00 Michael Niedermayer <michael@niedermayer.cc>:
> On Thu, Feb 16, 2017 at 02:16:21PM +0100, Carl Eugen Hoyos wrote:
>> 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
>
>>  riff.h    |    2 ++
>>  riffdec.c |    2 ++
>>  2 files changed, 4 insertions(+)
>> 9c34902b6f0c10778b90b4d67cca39319e340a27  0001-lavf-riff-Support-decoding-files-with-broken-mediasu.patch
>> From 3c409a0c633fcee5093f026b0ff786a87d9a7989 Mon Sep 17 00:00:00 2001
>> From: Thierry Foucu <tfoucu@gmail.com>
>> Date: Thu, 16 Feb 2017 14:03:38 +0100
>> Subject: [PATCH] lavf/riff: Support decoding files with broken mediasubtype
>>  base guid.
>>
>> Fixes ticket #6100.
>
> should be ok

Patch applied.

Thank you, Carl Eugen
diff mbox

Patch

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,