summaryrefslogtreecommitdiff
path: root/libavcodec/ac3.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-04-17 12:26:47 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-04-17 12:33:41 -0400
commit4c64c8e95a02b1d69aabb400fa73cba7ef8f41f7 (patch)
tree55cd9f8c552b63a083bd78377f870da358d0be88 /libavcodec/ac3.c
parent0b05864eef3d5323ee02515e3b62693230f7e4fb (diff)
downloadffmpeg-4c64c8e95a02b1d69aabb400fa73cba7ef8f41f7.tar.gz
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.
Diffstat (limited to 'libavcodec/ac3.c')
-rw-r--r--libavcodec/ac3.c4
1 files changed, 2 insertions, 2 deletions
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)