]> granicus.if.org Git - imagemagick/commitdiff
Minor code style refactoring.
authorDirk Lemstra <dirk@lemstra.org>
Tue, 13 Nov 2018 16:57:34 +0000 (17:57 +0100)
committerDirk Lemstra <dirk@lemstra.org>
Tue, 13 Nov 2018 16:57:34 +0000 (17:57 +0100)
coders/xcf.c

index ee98dddb76cbcfed2a550b016d1b3541e0de9d6a..4813211ddc93bbd21200f3c333099a9b4b66745d 100644 (file)
@@ -1181,17 +1181,15 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception)
   if ((doc_info.width > 262144) || (doc_info.height > 262144))
     ThrowReaderException(CorruptImageError,"ImproperImageHeader");
   doc_info.image_type=ReadBlobMSBLong(image);
-  if (doc_info.version >= 4) {
-    precision=ReadBlobMSBLong(image);
-    if (precision == 0) {
-      precision = 150;
+  precision=150;
+  if (doc_info.version >= 4)
+    {
+      precision=ReadBlobMSBLong(image);
+      if (precision == 0)
+        precision=150;
+      if (precision != 150)
+        ThrowReaderException(CoderError,"DataStorageTypeIsNotSupported");
     }
-  }
-  else {
-    precision=150;
-  }
-  if (precision != 150)
-    ThrowReaderException(CoderError,"ColorPrecisionNotSupported");
   /*
     Initialize image attributes.
   */