Skip to content

Commit

Permalink
Fixed comparison between unsigned int and int
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 22, 2020
1 parent 26e5929 commit 36dc83e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/libImaging/Jpeg2KDecode.c
Expand Up @@ -742,10 +742,12 @@ j2k_decode_entry(Imaging im, ImagingCodecState state)
swapped), bail. */
if (tile_info.x0 >= tile_info.x1
|| tile_info.y0 >= tile_info.y1
|| tile_info.x0 < (OPJ_INT32)image->x0
|| tile_info.y0 < (OPJ_INT32)image->y0
|| tile_info.x1 - image->x0 > im->xsize
|| tile_info.y1 - image->y0 > im->ysize) {
|| tile_info.x0 < 0
|| tile_info.y0 < 0
|| (OPJ_UINT32)tile_info.x0 < image->x0
|| (OPJ_UINT32)tile_info.y0 < image->y0
|| (OPJ_INT32)(tile_info.x1 - image->x0) > im->xsize
|| (OPJ_INT32)(tile_info.y1 - image->y0) > im->ysize) {
state->errcode = IMAGING_CODEC_BROKEN;
state->state = J2K_STATE_FAILED;
goto quick_exit;
Expand Down

0 comments on commit 36dc83e

Please sign in to comment.