[FFmpeg-soc] [soc]: r3325 - aac/aac.c

Michael Niedermayer michaelni at gmx.at
Fri Aug 15 14:25:48 CEST 2008


On Fri, Aug 15, 2008 at 01:47:53PM +0200, superdump wrote:
> Author: superdump
> Date: Fri Aug 15 13:47:52 2008
> New Revision: 3325
> 
> Log:
> Swap logic of tns_max_order condition for clarity
> 
> 
> Modified:
>    aac/aac.c
> 
> Modified: aac/aac.c
> ==============================================================================
> --- aac/aac.c	(original)
> +++ aac/aac.c	Fri Aug 15 13:47:52 2008
> @@ -738,7 +738,12 @@ static int decode_tns(AACContext * ac, T
>          for (filt = 0; filt < tns->n_filt[w]; filt++) {
>              tns->length[w][filt] = get_bits(gb, 6 - 2*is8);
>  
> -            if ((tns->order[w][filt] = get_bits(gb, 5 - 2*is8)) <= tns_max_order) {
> +            if ((tns->order[w][filt] = get_bits(gb, 5 - 2*is8)) > tns_max_order) {
> +                av_log(ac->avccontext, AV_LOG_ERROR, "TNS filter order %d is greater than maximum %d.",
> +                       tns->order[w][filt], tns_max_order);
> +                tns->order[w][filt] = 0;
> +                return -1;
> +            } else {

you dont need the else (because of the return) and also consistency wise
the code tends not to have else after error checks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is not what we do, but why we do it that matters.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080815/3ffc6eca/attachment.pgp>


More information about the FFmpeg-soc mailing list