aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/mp3_header_decompress_bsf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mp3_header_decompress_bsf.c')
-rw-r--r--libavcodec/mp3_header_decompress_bsf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mp3_header_decompress_bsf.c b/libavcodec/mp3_header_decompress_bsf.c
index 294858953c..ab3d420300 100644
--- a/libavcodec/mp3_header_decompress_bsf.c
+++ b/libavcodec/mp3_header_decompress_bsf.c
@@ -62,6 +62,11 @@ static int mp3_header_decompress(AVBSFContext *ctx, AVPacket *out)
lsf = sample_rate < (24000+32000)/2;
mpeg25 = sample_rate < (12000+16000)/2;
sample_rate_index= (header>>10)&3;
+ if (sample_rate_index == 3) {
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+
sample_rate= avpriv_mpa_freq_tab[sample_rate_index] >> (lsf + mpeg25); //in case sample rate is a little off
for(bitrate_index=2; bitrate_index<30; bitrate_index++){