Commit 4bc7268f authored by Thierry Foucu's avatar Thierry Foucu Committed by Carl Eugen Hoyos

lavf/riff: Support decoding files with broken mediasubtype base guid.

Fixes ticket #6100.
parent 04e61147
...@@ -109,6 +109,8 @@ extern const AVCodecGuid ff_codec_wav_guids[]; ...@@ -109,6 +109,8 @@ extern const AVCodecGuid ff_codec_wav_guids[];
0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71
#define FF_AMBISONIC_BASE_GUID \ #define FF_AMBISONIC_BASE_GUID \
0x21, 0x07, 0xD3, 0x11, 0x86, 0x44, 0xC8, 0xC1, 0xCA, 0x00, 0x00, 0x00 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) static av_always_inline int ff_guidcmp(const void *g1, const void *g2)
{ {
......
...@@ -71,6 +71,8 @@ static void parse_waveformatex(AVIOContext *pb, AVCodecParameters *par) ...@@ -71,6 +71,8 @@ static void parse_waveformatex(AVIOContext *pb, AVCodecParameters *par)
ff_get_guid(pb, &subformat); ff_get_guid(pb, &subformat);
if (!memcmp(subformat + 4, if (!memcmp(subformat + 4,
(const uint8_t[]){ FF_AMBISONIC_BASE_GUID }, 12) || (const uint8_t[]){ FF_AMBISONIC_BASE_GUID }, 12) ||
!memcmp(subformat + 4,
(const uint8_t[]){ FF_BROKEN_BASE_GUID }, 12) ||
!memcmp(subformat + 4, !memcmp(subformat + 4,
(const uint8_t[]){ FF_MEDIASUBTYPE_BASE_GUID }, 12)) { (const uint8_t[]){ FF_MEDIASUBTYPE_BASE_GUID }, 12)) {
par->codec_tag = AV_RL32(subformat); par->codec_tag = AV_RL32(subformat);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment