File ImageMagick-CVE-2018-9133.patch of Package ImageMagick.8212

diff --git a/coders/tiff.c b/coders/tiff.c
index 4158ad51a9..b6c656456d 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -2756,13 +2756,11 @@ static MagickBooleanType EncodeLabImage(Image *image,ExceptionInfo *exception)
     register ssize_t
       x;
 
-    if (status == MagickFalse)
-      continue;
     q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
     if (q == (PixelPacket *) NULL)
       {
         status=MagickFalse;
-        continue;
+        break;
       }
     for (x=0; x < (ssize_t) image->columns; x++)
     {
@@ -2781,7 +2779,10 @@ static MagickBooleanType EncodeLabImage(Image *image,ExceptionInfo *exception)
       q++;
     }
     if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
-      status=MagickFalse;
+      {
+        status=MagickFalse;
+        break;
+      }
   }
   image_view=DestroyCacheView(image_view);
   return(status);