Revision 4c64c8e9

View differences:

libavcodec/ac3.c
192 192

  
193 193
    if (dba_mode == DBA_REUSE || dba_mode == DBA_NEW) {
194 194
        int i, seg, delta;
195
        if (dba_nsegs >= 8)
195
        if (dba_nsegs > 8)
196 196
            return -1;
197
        band = 0;
197
        band = band_start;
198 198
        for (seg = 0; seg < dba_nsegs; seg++) {
199 199
            band += dba_offsets[seg];
200 200
            if (band >= AC3_CRITICAL_BANDS || dba_lengths[seg] > AC3_CRITICAL_BANDS-band)
libavcodec/ac3dec.c
1173 1173
        /* channel delta offset, len and bit allocation */
1174 1174
        for (ch = !cpl_in_use; ch <= fbw_channels; ch++) {
1175 1175
            if (s->dba_mode[ch] == DBA_NEW) {
1176
                s->dba_nsegs[ch] = get_bits(gbc, 3);
1177
                for (seg = 0; seg <= s->dba_nsegs[ch]; seg++) {
1176
                s->dba_nsegs[ch] = get_bits(gbc, 3) + 1;
1177
                for (seg = 0; seg < s->dba_nsegs[ch]; seg++) {
1178 1178
                    s->dba_offsets[ch][seg] = get_bits(gbc, 5);
1179 1179
                    s->dba_lengths[ch][seg] = get_bits(gbc, 4);
1180 1180
                    s->dba_values[ch][seg] = get_bits(gbc, 3);

Also available in: Unified diff