[FFmpeg-soc] [soc]: r2535 - aac/aac.c
Robert Swain
robert.swain at gmail.com
Sun Jun 22 13:35:12 CEST 2008
2008/6/22 superdump <subversion at mplayerhq.hu>:
> Author: superdump
> Date: Sun Jun 22 13:33:53 2008
> New Revision: 2535
>
> Log:
> Implement some checks of max_sfb and against max_sfb
>
>
> Modified:
> aac/aac.c
>
> Modified: aac/aac.c
> ==============================================================================
> --- aac/aac.c (original)
> +++ aac/aac.c Sun Jun 22 13:33:53 2008
> @@ -997,12 +997,26 @@ static int decode_ics_info(AACContext *
> }
> ics->swb_offset = swb_offset_128[ac->m4ac.sampling_index];
> ics->num_swb = num_swb_128[ac->m4ac.sampling_index];
> + if(ics->max_sfb > ics->num_swb) {
> + av_log(ac->avccontext, AV_LOG_ERROR,
> + "Number of scalefactor bands in group (%d) exceeds limit (%d)\n",
> + ics->max_sfb, ics->num_swb);
> + return -1;
> + }
> +
> ics->num_windows = 8;
> ics->tns_max_bands = tns_max_bands_128[ac->m4ac.sampling_index];
> } else {
> ics->max_sfb = get_bits(gb, 6);
> ics->swb_offset = swb_offset_1024[ac->m4ac.sampling_index];
> ics->num_swb = num_swb_1024[ac->m4ac.sampling_index];
> + if(ics->max_sfb > ics->num_swb) {
> + av_log(ac->avccontext, AV_LOG_ERROR,
> + "Number of scalefactor bands in group (%d) exceeds limit (%d)\n",
> + ics->max_sfb, ics->num_swb);
> + return -1;
> + }
> +
> ics->num_windows = 1;
> ics->tns_max_bands = tns_max_bands_1024[ac->m4ac.sampling_index];
> if (get_bits1(gb)) {
I didn't factorise this as just below there are function calls using
max_sfb so I wanted to check its value before it got used. I hope this
is acceptable.
Rob
More information about the FFmpeg-soc
mailing list