diff options
author | Google Chrome <> | 2010-02-09 19:45:16 +0000 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2010-02-09 19:45:16 +0000 |
commit | 0d3f25eb483f19a34e3354970333b87e04120ae2 (patch) | |
tree | ab0a81fa58551b35100fc6e151b986807c1a34e8 | |
parent | 9ef13f70f4d38514fa82b998f7e62abb7940f4c1 (diff) |
Sanity checks for magnitude and angle.
26_vorbis_mag_angle_index.patch by chrome
backport r19983 by michael
Originally committed as revision 21723 to svn://svn.ffmpeg.org/ffmpeg/branches/0.5
-rw-r--r-- | libavcodec/vorbis_dec.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c index cbde097b84..305ceadaa1 100644 --- a/libavcodec/vorbis_dec.c +++ b/libavcodec/vorbis_dec.c @@ -702,7 +702,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; |