Merge pull request #1253 from rouault/floating_point_irreversible_encoding
[openjpeg.git] / src / bin / jp2 / opj_decompress.c
index 4b9583b798e0c245b72cfff1b0c70b50e2ff4525..2634907f015452607d9dd35f9835c6015090e3b8 100644 (file)
@@ -1316,10 +1316,6 @@ static opj_image_t* upsample_image_components(opj_image_t* original)
 int main(int argc, char **argv)
 {
     opj_decompress_parameters parameters;           /* decompression parameters */
-    opj_image_t* image = NULL;
-    opj_stream_t *l_stream = NULL;              /* Stream */
-    opj_codec_t* l_codec = NULL;                /* Handle to a decompressor */
-    opj_codestream_index_t* cstr_index = NULL;
 
     OPJ_INT32 num_images, imageno;
     img_fol_t img_fol;
@@ -1393,6 +1389,10 @@ int main(int argc, char **argv)
 
     /*Decoding image one by one*/
     for (imageno = 0; imageno < num_images ; imageno++)  {
+        opj_image_t* image = NULL;
+        opj_stream_t *l_stream = NULL;              /* Stream */
+        opj_codec_t* l_codec = NULL;                /* Handle to a decompressor */
+        opj_codestream_index_t* cstr_index = NULL;
 
         if (!parameters.quiet) {
             fprintf(stderr, "\n");
@@ -1571,17 +1571,6 @@ int main(int argc, char **argv)
             }
         }
 
-        /* FIXME? Shouldn't that situation be considered as an error of */
-        /* opj_decode() / opj_get_decoded_tile() ? */
-        if (image->comps[0].data == NULL) {
-            fprintf(stderr, "ERROR -> opj_decompress: no image data!\n");
-            opj_destroy_codec(l_codec);
-            opj_stream_destroy(l_stream);
-            opj_image_destroy(image);
-            failed = 1;
-            goto fin;
-        }
-
         tCumulative += opj_clock() - t;
         numDecompressedImages++;