Browse Source

Sanity checks for magnitude and angle.

26_vorbis_mag_angle_index.patch by chrome

Originally committed as revision 19983 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Google Chrome Michael Niedermayer 16 years ago
parent
commit
d70fa8f131
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      libavcodec/vorbis_dec.c

+ 8
- 1
libavcodec/vorbis_dec.c View File

@@ -697,7 +697,14 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) {
for(j=0;j<mapping_setup->coupling_steps;++j) {
mapping_setup->magnitude[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 {
mapping_setup->coupling_steps=0;


Loading…
Cancel
Save