Skip to content

Commit

Permalink
[dep-quant] Fix read out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Jovasa committed Jul 1, 2024
1 parent 634cf72 commit 99ecc93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dep_quant.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ static INLINE void update_common_context(
uint8_t* sbbFlags = cc->m_allSbbCtx[cc->m_curr_sbb_ctx_offset].sbbFlags;
uint8_t* levels = cc->m_allSbbCtx[cc->m_curr_sbb_ctx_offset].levels;
size_t setCpSize = cc->m_nbInfo[scan_pos - 1].maxDist * sizeof(uint8_t);
int8_t prev_sbb_state = ctxs->m_allStates.m_refSbbCtxId[prev_state];
if (prev_state != -1 && prev_sbb_state >= 0) {
if (prev_state != -1) {
const int8_t prev_sbb_state = ctxs->m_allStates.m_refSbbCtxId[prev_state];
for (int i = 0; i < numSbb; ++i) {
sbbFlags[i * 4 + curr_state_without_offset] = cc->m_allSbbCtx[cc->m_prev_sbb_ctx_offset].sbbFlags[i * 4 + prev_sbb_state];
}
Expand Down

0 comments on commit 99ecc93

Please sign in to comment.