[FFmpeg-cvslog] r13653 - trunk/libavcodec/ac3.c

Michael Niedermayer michaelni
Wed Jun 4 13:10:54 CEST 2008


On Wed, Jun 04, 2008 at 01:34:26AM +0200, jbr wrote:
> Author: jbr
> Date: Wed Jun  4 01:34:26 2008
> New Revision: 13653
> 
> Log:
> prevent crash when dba params are invalid
> 
> Modified:
>    trunk/libavcodec/ac3.c
> 
> Modified: trunk/libavcodec/ac3.c
> ==============================================================================
> --- trunk/libavcodec/ac3.c	(original)
> +++ trunk/libavcodec/ac3.c	Wed Jun  4 01:34:26 2008
> @@ -157,8 +157,8 @@ void ff_ac3_bit_alloc_calc_mask(AC3BitAl
>      if (dba_mode == DBA_REUSE || dba_mode == DBA_NEW) {
>          int band, seg, delta;
>          band = 0;
> -        for (seg = 0; seg < dba_nsegs; seg++) {
> -            band += dba_offsets[seg];
> +        for (seg = 0; seg < FFMIN(8, dba_nsegs); seg++) {
> +            band = FFMIN(49, band + dba_offsets[seg]);
>              if (dba_values[seg] >= 4) {

shouldnt that end in a return -1 instead of silently cliping?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- 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-cvslog/attachments/20080604/b10d113c/attachment.pgp>



More information about the ffmpeg-cvslog mailing list