opj_compress: improve help message regarding new IMF switch
[openjpeg.git] / src / bin / jp2 / convert.c
index fa02e31c5a458a7d1a7e41b231756bc82d20ad0e..e670cd82fbe710107f4ee46697bdb3b5a13e38bf 100644 (file)
@@ -2233,6 +2233,11 @@ int imagetopnm(opj_image_t * image, const char *outfile, int force_split)
                 opj_version(), wr, hr, max);
 
         red = image->comps[compno].data;
+        if (!red) {
+            fclose(fdest);
+            continue;
+        }
+
         adjustR =
             (image->comps[compno].sgnd ? 1 << (image->comps[compno].prec - 1) : 0);