]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 4 Oct 2014 14:41:20 +0000 (14:41 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 4 Oct 2014 14:41:20 +0000 (14:41 +0000)
coders/jp2.c

index 9fcc6dfac209b59154c60f1e6ba14959373ab6fc..a47028d9779d56b7baeda2bb10df327ee0c4de6c 100644 (file)
@@ -348,6 +348,7 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception)
       opj_destroy_codec(jp2_codec);
       ThrowReaderException(DelegateError,"UnableToDecodeImageFile");
     }
+  jp2_status=0;
   if ((image->columns != 0) && (image->rows != 0))
     {
       /*
@@ -367,12 +368,13 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception)
   if (image_info->number_scenes != 0)
     jp2_status=opj_get_decoded_tile(jp2_codec,jp2_stream,jp2_image,
       (unsigned int) image_info->scene);
-  else if (image->ping == MagickFalse)
-    {
-      jp2_status=opj_decode(jp2_codec,jp2_stream,jp2_image);
-      if (jp2_status != 0)
-        jp2_status=opj_end_decompress(jp2_codec,jp2_stream);
-    }
+  else
+    if (image->ping == MagickFalse)
+      {
+        jp2_status=opj_decode(jp2_codec,jp2_stream,jp2_image);
+        if (jp2_status != 0)
+          jp2_status=opj_end_decompress(jp2_codec,jp2_stream);
+      }
   if (jp2_status == 0)
     {
       opj_stream_destroy(jp2_stream);