aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/vqf.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-09 18:04:54 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-09 18:05:19 +0100
commite481ba2ed79421d82ed631d187c05c03260c6561 (patch)
tree734c3962f54aa467ca93fc75036eb94377c4838e /libavformat/vqf.c
parentfb6a72cde52580bc92c92c8f02bb3eb7afb3fd71 (diff)
downloadffmpeg-e481ba2ed79421d82ed631d187c05c03260c6561.tar.gz
vqf: check samplerate, avoid division by 0.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/vqf.c')
-rw-r--r--libavformat/vqf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index 5fff84e049..f1e6aafd98 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -175,6 +175,10 @@ static int vqf_read_header(AVFormatContext *s)
break;
default:
st->codec->sample_rate = rate_flag*1000;
+ if (st->codec->sample_rate <= 0) {
+ av_log(s, AV_LOG_ERROR, "sample rate %d is invalid\n", st->codec->sample_rate);
+ return -1;
+ }
break;
}