diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-12-04 18:17:17 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-04 18:24:50 +0100 |
commit | cbf09545f250a4bd12c50c3a96fe481098ab2d49 (patch) | |
tree | 7acabcf33d333772d1381c5e72fb99b1205b6b6a /libavcodec/imc.c | |
parent | 291747581e3dd0620a92036c5669d22ed0f8c269 (diff) | |
download | ffmpeg-cbf09545f250a4bd12c50c3a96fe481098ab2d49.tar.gz |
avcodec/imc: only check remaining bits in case bits will be read
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/imc.c')
-rw-r--r-- | libavcodec/imc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 0d7c97b603..b367ccb172 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -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; } |