diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-04-09 22:31:40 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-04-09 23:21:38 +0200 |
commit | bf87d582b1cbbb5604d4e1521c4b674206e605a0 (patch) | |
tree | bf0802b3291e478f38b1feae51d9c439099ff94d /libavformat | |
parent | 2773ab36cc6480ce77845df0b1d1e2f790c59cde (diff) |
Do not allow writing invalid wav channel layouts by default.
Neither WMP nor QT play wav files with too large channel layouts.
Fixes ticket #3543.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/riffenc.c | 4 | ||||
-rw-r--r-- | libavformat/version.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c index c3e3e66b37..6c91cb693a 100644 --- a/libavformat/riffenc.c +++ b/libavformat/riffenc.c @@ -172,12 +172,14 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc) } /* write WAVEFORMATEXTENSIBLE extensions */ if (waveformatextensible) { + int write_channel_mask = enc->strict_std_compliance < FF_COMPLIANCE_NORMAL || + enc->channel_layout < 0x40000; /* 22 is WAVEFORMATEXTENSIBLE size */ avio_wl16(pb, riff_extradata - riff_extradata_start + 22); /* ValidBitsPerSample || SamplesPerBlock || Reserved */ avio_wl16(pb, bps); /* dwChannelMask */ - avio_wl32(pb, enc->channel_layout); + avio_wl32(pb, write_channel_mask ? enc->channel_layout : 0); /* GUID + next 3 */ if (enc->codec_id == AV_CODEC_ID_EAC3) { ff_put_guid(pb, get_codec_guid(enc->codec_id, ff_codec_wav_guids)); diff --git a/libavformat/version.h b/libavformat/version.h index fe54380304..3d2bb6d008 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,7 +31,7 @@ #define LIBAVFORMAT_VERSION_MAJOR 55 #define LIBAVFORMAT_VERSION_MINOR 36 -#define LIBAVFORMAT_VERSION_MICRO 102 +#define LIBAVFORMAT_VERSION_MICRO 103 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ |