Added checks for depth.
diff --git a/coders/sun.c b/coders/sun.c
index 303ed18..4158d4c 100644
--- a/coders/sun.c
+++ b/coders/sun.c
@@ -313,7 +313,8 @@
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     if ((sun_info.maptype == RMT_NONE) && (sun_info.maplength != 0))
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
-    if ((sun_info.depth == 0) || (sun_info.depth > 32))
+    if ((sun_info.depth != 1) && (sun_info.depth != 8) &&
+        (sun_info.depth != 16) && (sun_info.depth != 32))
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     if ((sun_info.maptype != RMT_NONE) && (sun_info.maptype != RMT_EQUAL_RGB) &&
         (sun_info.maptype != RMT_RAW))