aboutsummaryrefslogtreecommitdiff
path: root/gst-libs/ext/libav/libavformat/vqf.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/ext/libav/libavformat/vqf.c')
-rw-r--r--gst-libs/ext/libav/libavformat/vqf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gst-libs/ext/libav/libavformat/vqf.c b/gst-libs/ext/libav/libavformat/vqf.c
index 66ced37..aba6ab1 100644
--- a/gst-libs/ext/libav/libavformat/vqf.c
+++ b/gst-libs/ext/libav/libavformat/vqf.c
@@ -174,10 +174,21 @@ static int vqf_read_header(AVFormatContext *s)
st->codec->sample_rate = 11025;
break;
default:
+ if (rate_flag < 8 || rate_flag > 44) {
+ av_log(s, AV_LOG_ERROR, "Invalid rate flag %d\n", rate_flag);
+ return AVERROR_INVALIDDATA;
+ }
st->codec->sample_rate = rate_flag*1000;
break;
}
+ if (read_bitrate / st->codec->channels < 8 ||
+ read_bitrate / st->codec->channels > 48) {
+ av_log(s, AV_LOG_ERROR, "Invalid bitrate per channel %d\n",
+ read_bitrate / st->codec->channels);
+ return AVERROR_INVALIDDATA;
+ }
+
switch (((st->codec->sample_rate/1000) << 8) +
read_bitrate/st->codec->channels) {
case (11<<8) + 8 :