summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthieu Darbois <mayeut@users.noreply.github.com>2016-04-28 19:20:14 +0200
committerMatthieu Darbois <mayeut@users.noreply.github.com>2016-04-28 19:20:14 +0200
commite166e4a209d9a3e4b583e4b2cdcbab2c57967eb1 (patch)
treeb702329b458aeb8f10b1ae4237b2c230ee05a3ea /src
parent29313eb5f1b2c01c7493087fa2d8f1a20495a34e (diff)
Check SSIZ is valid in opj_j2k_read_siz (#762)
Diffstat (limited to 'src')
-rw-r--r--src/lib/openjp2/j2k.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c
index 525f629a..f6be14de 100644
--- a/src/lib/openjp2/j2k.c
+++ b/src/lib/openjp2/j2k.c
@@ -2154,10 +2154,16 @@ static OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k,
if( l_img_comp->dx < 1 || l_img_comp->dx > 255 ||
l_img_comp->dy < 1 || l_img_comp->dy > 255 ) {
opj_event_msg(p_manager, EVT_ERROR,
- "Invalid values for comp = %d : dx=%u dy=%u\n (should be between 1 and 255 according the JPEG2000 norm)",
+ "Invalid values for comp = %d : dx=%u dy=%u (should be between 1 and 255 according to the JPEG2000 norm)\n",
i, l_img_comp->dx, l_img_comp->dy);
return OPJ_FALSE;
}
+ if( l_img_comp->prec > 38) { /* TODO openjpeg won't handle more than ? */
+ opj_event_msg(p_manager, EVT_ERROR,
+ "Invalid values for comp = %d : prec=%u (should be between 1 and 38 according to the JPEG2000 norm)\n",
+ i, l_img_comp->prec);
+ return OPJ_FALSE;
+ }
#ifdef USE_JPWL
if (l_cp->correct) {