Skip to content

Commit

Permalink
jpc_cs: reject all but JPC_COX_INS and JPC_COX_RFT
Browse files Browse the repository at this point in the history
Fixes assertion failure JPC_NOMINALGAIN() which can be caused by a
crafted JP2 file.

Closes #50, #142
  • Loading branch information
MaxKellermann committed Oct 6, 2017
1 parent 1a36ca3 commit a10536d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libjasper/jpc/jpc_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,9 @@ static int jpc_cox_getcompparms(jpc_ms_t *ms, jpc_cstate_t *cstate,
if (compparms->numdlvls > 32) {
goto error;
}
if (compparms->qmfbid != JPC_COX_INS &&
compparms->qmfbid != JPC_COX_RFT)
goto error;
compparms->numrlvls = compparms->numdlvls + 1;
if (compparms->numrlvls > JPC_MAXRLVLS) {
goto error;
Expand Down

0 comments on commit a10536d

Please sign in to comment.