Browse Source

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.
tags/n2.3
Carl Eugen Hoyos 12 years ago
parent
commit
bf87d582b1
2 changed files with 4 additions and 2 deletions
  1. +3
    -1
      libavformat/riffenc.c
  2. +1
    -1
      libavformat/version.h

+ 3
- 1
libavformat/riffenc.c View File

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


+ 1
- 1
libavformat/version.h View File

@@ -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, \


Loading…
Cancel
Save