Mercurial > libavcodec.hg
changeset 6998:d32b97ccfd42 libavcodec
prevent crash when dba params are invalid
author | jbr |
---|---|
date | Tue, 03 Jun 2008 23:34:26 +0000 |
parents | d83420509f90 |
children | 3d84a99ecfa7 |
files | ac3.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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 {