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:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-30 01:41:13 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-09-30 01:41:16 +0400
commit5badcfe2200c896534c7d8575ab321415fcf7358 (patch)
treeb5ac3e0cfac8dfe30f56a4bf757592ced3da85f7 /libavformat/riffdec.c
parenta89e9ad1c8625e332764c3cd61fd469b3eb92140 (diff)
parentd07aa3f02b73ab1371c13ac7898338380ca0932b (diff)
Merge commit 'd07aa3f02b73ab1371c13ac7898338380ca0932b'
* commit 'd07aa3f02b73ab1371c13ac7898338380ca0932b': riffdec: Add sanity checks for the sample rate Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/riffdec.c')
-rw-r--r--libavformat/riffdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c
index 973f3fada9..e7c52e09c3 100644
--- a/libavformat/riffdec.c
+++ b/libavformat/riffdec.c
@@ -130,6 +130,11 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
if (size > 0)
avio_skip(pb, size);
}
+ if (codec->sample_rate <= 0) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Invalid sample rate: %d\n", codec->sample_rate);
+ return AVERROR_INVALIDDATA;
+ }
if (codec->codec_id == AV_CODEC_ID_AAC_LATM) {
/* Channels and sample_rate values are those prior to applying SBR
* and/or PS. */