From 4c64c8e95a02b1d69aabb400fa73cba7ef8f41f7 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sun, 17 Apr 2011 12:26:47 -0400 Subject: ac3dec: fix processing of delta bit allocation information. The number of dba segments is the coded value + 1. The coupling dba offset starts at the first coupling band, not at zero. --- libavcodec/ac3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavcodec/ac3.c') diff --git a/libavcodec/ac3.c b/libavcodec/ac3.c index 704c6e03a6..99e5b50acb 100644 --- a/libavcodec/ac3.c +++ b/libavcodec/ac3.c @@ -192,9 +192,9 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd, if (dba_mode == DBA_REUSE || dba_mode == DBA_NEW) { int i, seg, delta; - if (dba_nsegs >= 8) + if (dba_nsegs > 8) return -1; - band = 0; + band = band_start; for (seg = 0; seg < dba_nsegs; seg++) { band += dba_offsets[seg]; if (band >= AC3_CRITICAL_BANDS || dba_lengths[seg] > AC3_CRITICAL_BANDS-band) -- cgit v1.2.3