[FFmpeg-cvslog] r19983 - trunk/libavcodec/vorbis_dec.c
michael
subversion
Wed Sep 23 12:40:33 CEST 2009
Author: michael
Date: Wed Sep 23 12:40:33 2009
New Revision: 19983
Log:
Sanity checks for magnitude and angle.
26_vorbis_mag_angle_index.patch by chrome
Modified:
trunk/libavcodec/vorbis_dec.c
Modified: trunk/libavcodec/vorbis_dec.c
==============================================================================
--- trunk/libavcodec/vorbis_dec.c Wed Sep 23 12:33:49 2009 (r19982)
+++ trunk/libavcodec/vorbis_dec.c Wed Sep 23 12:40:33 2009 (r19983)
@@ -697,7 +697,14 @@ static int vorbis_parse_setup_hdr_mappin
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;
More information about the ffmpeg-cvslog
mailing list