Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2012-05-02 18:34:45 +0400
committerAnton Khirnov <anton@khirnov.net>2016-07-22 20:08:12 +0300
commit7f549b8338ed3775fec4bf10421ff5744e5866dd (patch)
tree708bf5a89e3557de7e88ba0174815623fe459b5a /libavformat/riffdec.c
parent6135c3b61e084be93c0876cecd06f4e764f961c0 (diff)
riff: don't overwrite bps from WAVEFORMATEX if EXTENSIBLE doesn't contain that data.
According to the specification on the MSDN [1], 0 is valid for that particular field, and it should be ignored in that case. [1]: http://msdn.microsoft.com/en-us/library/windows/desktop/dd757714(v=vs.85).aspx Bug-Id: 950 Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/riffdec.c')
-rw-r--r--libavformat/riffdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c
index 531413c943..81248355e3 100644
--- a/libavformat/riffdec.c
+++ b/libavformat/riffdec.c
@@ -57,7 +57,11 @@ enum AVCodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid)
static void parse_waveformatex(AVIOContext *pb, AVCodecParameters *par)
{
ff_asf_guid subformat;
- par->bits_per_coded_sample = avio_rl16(pb);
+ int bps;
+
+ bps = avio_rl16(pb);
+ if (bps)
+ par->bits_per_coded_sample = bps;
par->channel_layout = avio_rl32(pb); /* dwChannelMask */
ff_get_guid(pb, &subformat);