Browse Source

avcodec/imc: only check remaining bits in case bits will be read

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.6
Michael Niedermayer 11 years ago
parent
commit
cbf09545f2
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      libavcodec/imc.c

+ 7
- 6
libavcodec/imc.c View File

@@ -803,14 +803,15 @@ static void imc_get_coeffs(AVCodecContext *avctx,
cw_len = chctx->CWlengthT[j];
cw = 0;

if (get_bits_count(&q->gb) + cw_len > 512) {
av_log(avctx, AV_LOG_WARNING,
"Potential problem on band %i, coefficient %i"
": cw_len=%i\n", i, j, cw_len);
}
if (cw_len && (!chctx->bandFlagsBuf[i] || !chctx->skipFlags[j])) {
if (get_bits_count(&q->gb) + cw_len > 512) {
av_log(avctx, AV_LOG_WARNING,
"Potential problem on band %i, coefficient %i"
": cw_len=%i\n", i, j, cw_len);
}

if (cw_len && (!chctx->bandFlagsBuf[i] || !chctx->skipFlags[j]))
cw = get_bits(&q->gb, cw_len);
}

chctx->codewords[j] = cw;
}


Loading…
Cancel
Save