1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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

Fixes ticket #6100.
This commit is contained in:
Thierry Foucu 2017-02-16 14:03:38 +01:00 committed by Carl Eugen Hoyos
parent 04e611474b
commit 4bc7268f2b
2 changed files with 4 additions and 0 deletions

View File

@ -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)
{ {

View File

@ -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);