Skip to content

Commit 99ecc93

Browse files
committed
[dep-quant] Fix read out of bounds
1 parent 634cf72 commit 99ecc93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/dep_quant.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ static INLINE void update_common_context(
573573
uint8_t* sbbFlags = cc->m_allSbbCtx[cc->m_curr_sbb_ctx_offset].sbbFlags;
574574
uint8_t* levels = cc->m_allSbbCtx[cc->m_curr_sbb_ctx_offset].levels;
575575
size_t setCpSize = cc->m_nbInfo[scan_pos - 1].maxDist * sizeof(uint8_t);
576-
int8_t prev_sbb_state = ctxs->m_allStates.m_refSbbCtxId[prev_state];
577-
if (prev_state != -1 && prev_sbb_state >= 0) {
576+
if (prev_state != -1) {
577+
const int8_t prev_sbb_state = ctxs->m_allStates.m_refSbbCtxId[prev_state];
578578
for (int i = 0; i < numSbb; ++i) {
579579
sbbFlags[i * 4 + curr_state_without_offset] = cc->m_allSbbCtx[cc->m_prev_sbb_ctx_offset].sbbFlags[i * 4 + prev_sbb_state];
580580
}

0 commit comments

Comments
 (0)