[trunk] fixed bug related to r2791
authorAntonin Descampe <antonin@gmail.com>
Tue, 25 Mar 2014 15:35:33 +0000 (15:35 +0000)
committerAntonin Descampe <antonin@gmail.com>
Tue, 25 Mar 2014 15:35:33 +0000 (15:35 +0000)
src/bin/jp2/opj_compress.c

index 3cd63e2b9e84649d7895f27e8e6bad095bd0a81c..f3a20d0db24f6e505089cc9ad30de0445a4633e9 100644 (file)
@@ -1476,7 +1476,7 @@ int main(int argc, char **argv) {
     memset(&img_fol,0,sizeof(img_fol_t));
 
     /* parse input and get user encoding parameters */
-    parameters.tcp_mct = -1; /* This will be set later according to the input image or the provided option */
+    parameters.tcp_mct = (char) 255; /* This will be set later according to the input image or the provided option */
     if(parse_cmdline_encoder(argc, argv, &parameters,&img_fol, &raw_cp, indexfilename) == 1) {
         return 1;
     }
@@ -1636,8 +1636,8 @@ int main(int argc, char **argv) {
         }
 
         /* Decide if MCT should be used */
-        if (parameters.tcp_mct == -1) { /* mct mode has not been set in commandline */
-            parameters.tcp_mct = image->numcomps >= 3 ? 1 : 0;
+        if (parameters.tcp_mct == (char) 255) { /* mct mode has not been set in commandline */
+            parameters.tcp_mct = (image->numcomps >= 3) ? 1 : 0;
         } else {            /* mct mode has been set in commandline */
             if ((parameters.tcp_mct == 1) && (image->numcomps < 3)){
                 fprintf(stderr, "RGB->YCC conversion cannot be used:\n");