Blob Blame History Raw
From 9aa42a7ea0c943a6be3e3deb65de785f4890a2cf Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Wed, 9 Dec 2020 01:41:35 +0000
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick6/issues/117

---
 coders/sun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coders/sun.c b/coders/sun.c
index 985fe87dfc..e3e1827601 100644
--- a/coders/sun.c
+++ b/coders/sun.c
@@ -489,7 +489,7 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
       }
     else
       {
-        if (sun_info.length > pixels_length)
+        if (sun_info.length > (pixels_length+image->rows))
           {
             sun_data=(unsigned char *) RelinquishMagickMemory(sun_data);
             sun_pixels=(unsigned char *) RelinquishMagickMemory(sun_pixels);