From 7ae6a670fae0267ae7bb5c3bca144520d0cacdf9 Mon Sep 17 00:00:00 2001 From: Francois-Olivier Devaux Date: Thu, 2 Jun 2005 15:25:25 +0000 Subject: [PATCH] Conversions from int to unsigned int to ensure correct execution of int_min and int_max at lines 800 to 830 --- libopenjpeg/tcd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c index 58c660e1..017b638e 100644 --- a/libopenjpeg/tcd.c +++ b/libopenjpeg/tcd.c @@ -585,8 +585,8 @@ void tcd_init_encode(j2k_image_t * img, j2k_cp_t * cp, int curtileno) void tcd_init(j2k_image_t * img, j2k_cp_t * cp) { - int tileno, compno, resno, bandno, precno, cblkno, i, j; - unsigned int x0 = 0, y0 = 0, x1 = 0, y1 = 0, w, h, p, q; + int tileno, compno, resno, bandno, precno, cblkno, i, j, p, q; + unsigned int x0 = 0, y0 = 0, x1 = 0, y1 = 0, w, h; tcd_img = img; tcd_cp = cp; tcd_image.tw = cp->tw; @@ -798,6 +798,7 @@ void tcd_init(j2k_image_t * img, j2k_cp_t * cp) for (j = 0; j < cp->tileno_size; j++) { tileno = cp->tileno[j]; x0 = j == 0 ? tcd_image.tiles[tileno].comps[i].x0 : int_min(x0, + (unsigned int) tcd_image. tiles [tileno]. @@ -805,6 +806,7 @@ void tcd_init(j2k_image_t * img, j2k_cp_t * cp) [i].x0); y0 = j == 0 ? tcd_image.tiles[tileno].comps[i].y0 : int_min(y0, + (unsigned int) tcd_image. tiles [tileno]. @@ -812,6 +814,7 @@ void tcd_init(j2k_image_t * img, j2k_cp_t * cp) y0); x1 = j == 0 ? tcd_image.tiles[tileno].comps[i].x1 : int_max(x1, + (unsigned int) tcd_image. tiles [tileno]. @@ -819,14 +822,13 @@ void tcd_init(j2k_image_t * img, j2k_cp_t * cp) x1); y1 = j == 0 ? tcd_image.tiles[tileno].comps[i].y1 : int_max(y1, + (unsigned int) tcd_image. tiles [tileno]. comps[i]. y1); } - //w = int_ceildiv(x1 - x0, img->comps[i].dx); - //h = int_ceildiv(y1 - y0, img->comps[i].dy); w = x1 - x0;