Commit cbf09545 authored by Michael Niedermayer's avatar Michael Niedermayer

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

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 29174758
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment