Skip to content

Commit

Permalink
opj_t1_decode_cblk(): avoid undefined shift behaviour. Fixes https://…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jul 29, 2017
1 parent f6551f8 commit db9ef99
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib/openjp2/t1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,18 @@ static OPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1,
}

bpno_plus_one = (OPJ_INT32)(roishift + cblk->numbps);
if (bpno_plus_one >= 31) {
if (p_manager_mutex) {
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_WARNING,
"opj_t1_decode_cblk(): unsupported bpno_plus_one = %d >= 31\n",
bpno_plus_one);
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
}
return OPJ_FALSE;
}
passtype = 2;

opj_mqc_resetstates(mqc);
Expand Down

0 comments on commit db9ef99

Please sign in to comment.