# HG changeset patch # User jbr # Date 1212536066 0 # Node ID d32b97ccfd42eaccb9bf163eacf26bb5cfaa6521 # Parent d83420509f9067315bdde1b0a7b2a534bdb07f73 prevent crash when dba params are invalid diff -r d83420509f90 -r d32b97ccfd42 ac3.c --- a/ac3.c Tue Jun 03 16:46:38 2008 +0000 +++ b/ac3.c Tue Jun 03 23:34:26 2008 +0000 @@ -157,8 +157,8 @@ 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 {