Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check SSIZ is valid in opj_j2k_read_siz #762

Merged
merged 1 commit into from
Apr 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion tests/nonregression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set(BLACKLIST_JPEG2000_TMP
#edf_c2_20.jp2 #looks ok as per kdu_jp2info
edf_c2_1377017.jp2
edf_c2_1002767.jp2
#edf_c2_10025.jp2
edf_c2_10025.jp2
edf_c2_1000234.jp2
edf_c2_225881.jp2
edf_c2_1000671.jp2
Expand All @@ -46,6 +46,7 @@ set(BLACKLIST_JPEG2000_TMP
edf_c2_101463.jp2
edf_c2_1674177.jp2
edf_c2_1673169.jp2
issue418.jp2
issue429.jp2
issue427-null-image-size.jp2
issue427-illegal-tile-offset.jp2
Expand Down