suppress warning during build using clang 1494/head
authorTomoaki Teshima <tomoaki.teshima@gmail.com>
Fri, 8 Dec 2023 11:56:37 +0000 (20:56 +0900)
committerTomoaki Teshima <tomoaki.teshima@gmail.com>
Fri, 8 Dec 2023 11:56:37 +0000 (20:56 +0900)
src/lib/openjp2/j2k.c
src/lib/openjp2/tcd.c

index 9dbba8f1be3f3108b779ec7719ceec1e1d4246ab..be781e8093c42c16aecb677b96f933d3a07fdbe8 100644 (file)
@@ -7815,7 +7815,7 @@ OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k,
                                        image->comps[0].h * image->comps[0].prec) /
                                       ((double)parameters->tcp_rates[parameters->tcp_numlayers - 1] * 8 *
                                        image->comps[0].dx * image->comps[0].dy));
-            if (temp_size > INT_MAX) {
+            if (temp_size > (OPJ_FLOAT32)INT_MAX) {
                 parameters->max_cs_size = INT_MAX;
             } else {
                 parameters->max_cs_size = (int) floor(temp_size);
index 438247b60217a95f0e378bddcd9a661a3f7b79a0..55e9a088c2a1f9e0788db86c1a5603048a0a565b 100644 (file)
@@ -2330,7 +2330,7 @@ static OPJ_BOOL opj_tcd_dc_level_shift_decode(opj_tcd_t *p_tcd)
             for (j = 0; j < l_height; ++j) {
                 for (i = 0; i < l_width; ++i) {
                     OPJ_FLOAT32 l_value = *((OPJ_FLOAT32 *) l_current_ptr);
-                    if (l_value > INT_MAX) {
+                    if (l_value > (OPJ_FLOAT32)INT_MAX) {
                         *l_current_ptr = l_max;
                     } else if (l_value < INT_MIN) {
                         *l_current_ptr = l_min;