openjp2/j2k: Report error if all wanted components are not decoded.
[openjpeg.git] / src / bin / jp2 / opj_compress.c
index 2cc2970f62189caec4b6b94b1bce74595d1e684e..148bf951d748214fbfcf41010298e8095927f0f1 100644 (file)
@@ -824,7 +824,7 @@ static int parse_cmdline_encoder(int argc, char **argv,
             parameters->tcp_numlayers = (int)numlayers;
             numresolution = (OPJ_UINT32)parameters->numresolution;
             matrix_width = numresolution * 3;
-            parameters->cp_matrice = (int *) malloc(numlayers * matrix_width * sizeof(int));
+            parameters->cp_matrice = (int *) malloc(sizeof(int) * numlayers * matrix_width);
             if (parameters->cp_matrice == NULL) {
                 return 1;
             }