Commit 9062cd35 authored by Michael Niedermayer's avatar Michael Niedermayer

Check validity of channels & samplerate.

This may be security relevant.
Based on 2 patches by chrome.

Originally committed as revision 19975 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 428984b0
...@@ -848,8 +848,16 @@ static int vorbis_parse_id_hdr(vorbis_context *vc){ ...@@ -848,8 +848,16 @@ static int vorbis_parse_id_hdr(vorbis_context *vc){
} }
vc->version=get_bits_long(gb, 32); //FIXME check 0 vc->version=get_bits_long(gb, 32); //FIXME check 0
vc->audio_channels=get_bits(gb, 8); //FIXME check >0 vc->audio_channels=get_bits(gb, 8);
vc->audio_samplerate=get_bits_long(gb, 32); //FIXME check >0 if(vc->audio_channels <= 0){
av_log(vc->avccontext, AV_LOG_ERROR, "Invalid number of channels\n");
return -1;
}
vc->audio_samplerate=get_bits_long(gb, 32);
if(vc->audio_samplerate <= 0){
av_log(vc->avccontext, AV_LOG_ERROR, "Invalid samplerate\n");
return -1;
}
vc->bitrate_maximum=get_bits_long(gb, 32); vc->bitrate_maximum=get_bits_long(gb, 32);
vc->bitrate_nominal=get_bits_long(gb, 32); vc->bitrate_nominal=get_bits_long(gb, 32);
vc->bitrate_minimum=get_bits_long(gb, 32); vc->bitrate_minimum=get_bits_long(gb, 32);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment