History

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

Michael Niedermayer committed 11 years ago

Commit cbf09541 parent 29174751 file · +7 −6Browse files

Unified · Split

libavcodec/imc.c+7−6
@@ -803,14 +803,15 @@ static void imc_get_coeffs(AVCodecContext *avctx, · 802 unmodified lines
803803 cw_len = chctx->CWlengthT[j];
804804 cw = 0;
805805
806− if (get_bits_count(&q->gb) + cw_len > 512) {
807− av_log(avctx, AV_LOG_WARNING,
808− "Potential problem on band %i, coefficient %i"
809− ": cw_len=%i\n", i, j, cw_len);
810− }
806+ if (cw_len && (!chctx->bandFlagsBuf[i] || !chctx->skipFlags[j])) {
807+ if (get_bits_count(&q->gb) + cw_len > 512) {
808+ av_log(avctx, AV_LOG_WARNING,
809+ "Potential problem on band %i, coefficient %i"
810+ ": cw_len=%i\n", i, j, cw_len);
811+ }
811812
812− if (cw_len && (!chctx->bandFlagsBuf[i] || !chctx->skipFlags[j]))
813813 cw = get_bits(&q->gb, cw_len);
814+ }
814815
815816 chctx->codewords[j] = cw;
816817 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t