Commit b8f5dcd9 authored by michael's avatar michael

Sanity checks for magnitude and angle.

26_vorbis_mag_angle_index.patch by chrome


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19983 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0a7e56db
...@@ -697,7 +697,14 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) { ...@@ -697,7 +697,14 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) {
for(j=0;j<mapping_setup->coupling_steps;++j) { for(j=0;j<mapping_setup->coupling_steps;++j) {
mapping_setup->magnitude[j]=get_bits(gb, ilog(vc->audio_channels-1)); mapping_setup->magnitude[j]=get_bits(gb, ilog(vc->audio_channels-1));
mapping_setup->angle[j]=get_bits(gb, ilog(vc->audio_channels-1)); mapping_setup->angle[j]=get_bits(gb, ilog(vc->audio_channels-1));
// FIXME: sanity checks if (mapping_setup->magnitude[j]>=vc->audio_channels) {
av_log(vc->avccontext, AV_LOG_ERROR, "magnitude channel %d out of range. \n", mapping_setup->magnitude[j]);
return 1;
}
if (mapping_setup->angle[j]>=vc->audio_channels) {
av_log(vc->avccontext, AV_LOG_ERROR, "angle channel %d out of range. \n", mapping_setup->angle[j]);
return 1;
}
} }
} else { } else {
mapping_setup->coupling_steps=0; mapping_setup->coupling_steps=0;
......
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