]> granicus.if.org Git - imagemagick/commitdiff
Refactor code because it now looks like true == false.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sat, 28 Apr 2018 12:43:59 +0000 (14:43 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sat, 28 Apr 2018 12:43:59 +0000 (14:43 +0200)
coders/xcf.c

index 88fa631af7b2d6a9e6a5f43f8ebf8b8adf0aa5cd..e619a935e8a111ee40d9512b5c8c7788a5921fa3 100644 (file)
@@ -678,13 +678,12 @@ static MagickBooleanType load_level(Image *image,XCFDocInfo *inDocInfo,
       switch (inDocInfo->compression)
       {
         case COMPRESS_NONE:
-          if (load_tile(image,tile_image,inDocInfo,inLayerInfo,(size_t) (offset2-offset),exception) == 0)
-            status=MagickTrue;
+          status=load_tile(image,tile_image,inDocInfo,inLayerInfo,(size_t)
+            (offset2-offset),exception);
           break;
         case COMPRESS_RLE:
-          if (load_tile_rle (image,tile_image,inDocInfo,inLayerInfo,
-              (int) (offset2-offset),exception) == 0)
-            status=MagickTrue;
+          status=load_tile_rle(image,tile_image,inDocInfo,inLayerInfo,(size_t)
+            (offset2-offset),exception);
           break;
         case COMPRESS_ZLIB:
           tile_image=DestroyImage(tile_image);
@@ -697,10 +696,13 @@ static MagickBooleanType load_level(Image *image,XCFDocInfo *inDocInfo,
       }
 
       /* composite the tile onto the layer's image, and then destroy it */
-      (void) CompositeImage(inLayerInfo->image,tile_image,CopyCompositeOp,
-        MagickTrue,destLeft * TILE_WIDTH,destTop*TILE_HEIGHT,exception);
+      if (status != MagickFalse)
+        (void) CompositeImage(inLayerInfo->image,tile_image,CopyCompositeOp,
+          MagickTrue,destLeft * TILE_WIDTH,destTop*TILE_HEIGHT,exception);
       tile_image=DestroyImage(tile_image);
 
+      if (status == MagickFalse)
+        return(MagickFalse);
       /* adjust tile position */
       destLeft++;
       if (destLeft >= (int) ntile_cols)
@@ -708,8 +710,6 @@ static MagickBooleanType load_level(Image *image,XCFDocInfo *inDocInfo,
           destLeft = 0;
           destTop++;
         }
-      if (status != MagickFalse)
-        return(MagickFalse);
       /* restore the saved position so we'll be ready to
        *  read the next offset.
        */