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

jbr subversion
Wed Jun 4 01:34:26 CEST 2008


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) {
                 delta = (dba_values[seg] - 3) << 7;
             } else {




More information about the ffmpeg-cvslog mailing list