Commit b3b8c0a45 for imagemagick.org

commit b3b8c0a45c55d680d36ba9189b9b74320f75fd68
Author: Cristy <urban-warrior@imagemagick.org>
Date:   Sat Sep 19 08:41:26 2026 -0400

    continue after parsing DOCTYPE

diff --git a/MagickCore/color.c b/MagickCore/color.c
index b38b4527f..ff8177093 100644
--- a/MagickCore/color.c
+++ b/MagickCore/color.c
@@ -2063,6 +2063,7 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *cache,const char *xml,
                       }
             }
         }
+        continue;
       }
     if (LocaleNCompare(keyword,"<!--",4) == 0)
       {
diff --git a/MagickCore/configure.c b/MagickCore/configure.c
index 63aec4e32..6a910ffd2 100644
--- a/MagickCore/configure.c
+++ b/MagickCore/configure.c
@@ -1230,6 +1230,7 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *cache,
                       }
             }
         }
+        continue;
       }
     if (LocaleNCompare(keyword,"<!--",4) == 0)
       {
diff --git a/MagickCore/delegate.c b/MagickCore/delegate.c
index d88ef4b0b..6ca481cec 100644
--- a/MagickCore/delegate.c
+++ b/MagickCore/delegate.c
@@ -2180,6 +2180,7 @@ static MagickBooleanType LoadDelegateCache(LinkedListInfo *cache,
                       }
             }
         }
+        continue;
       }
     if (LocaleNCompare(keyword,"<!--",4) == 0)
       {
diff --git a/MagickCore/locale.c b/MagickCore/locale.c
index 52c9c8f15..1406f8215 100644
--- a/MagickCore/locale.c
+++ b/MagickCore/locale.c
@@ -1254,6 +1254,7 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *cache,const char *xml,
                       }
             }
         }
+        continue;
       }
     if (LocaleNCompare(keyword,"<!--",4) == 0)
       {
diff --git a/MagickCore/log.c b/MagickCore/log.c
index 2912b5e2f..4c7f1df01 100644
--- a/MagickCore/log.c
+++ b/MagickCore/log.c
@@ -981,6 +981,7 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *cache,const char *xml,
                       }
             }
         }
+        continue;
       }
     if (LocaleNCompare(keyword,"<!--",4) == 0)
       {
diff --git a/MagickCore/opencl.c b/MagickCore/opencl.c
index aaec80cc3..f1bd70ba9 100644
--- a/MagickCore/opencl.c
+++ b/MagickCore/opencl.c
@@ -836,6 +836,7 @@ static void LoadOpenCLDeviceBenchmark(MagickCLEnv clEnv,const char *xml)
                       }
             }
         }
+        continue;
       }
     if (LocaleNCompare(keyword,"<!--",4) == 0)
       {
diff --git a/MagickCore/policy.c b/MagickCore/policy.c
index 7c95da46f..fe5dd1302 100644
--- a/MagickCore/policy.c
+++ b/MagickCore/policy.c
@@ -1179,6 +1179,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *cache,
                       }
             }
         }
+        continue;
       }
     if (LocaleNCompare(keyword,"<!--",4) == 0)
       {
diff --git a/MagickCore/type.c b/MagickCore/type.c
index 7f426811c..c5c1bfc68 100644
--- a/MagickCore/type.c
+++ b/MagickCore/type.c
@@ -1155,6 +1155,7 @@ static MagickBooleanType LoadTypeCache(SplayTreeInfo *cache,const char *xml,
                       }
             }
         }
+        continue;
       }
     if (LocaleNCompare(keyword,"<!--",4) == 0)
       {
diff --git a/coders/psd.c b/coders/psd.c
index 530fa1787..6b991a617 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -2029,6 +2029,13 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,
     layer_info[i].page.x=left;
     layer_info[i].page.width=(size_t) (right-left);
     layer_info[i].page.height=(size_t) (bottom-top);
+    if ((layer_info[i].page.width > 300000) ||
+        (layer_info[i].page.height > 300000))
+      {
+        layer_info=DestroyLayerInfo(layer_info,number_layers);
+        ThrowBinaryException(ImageError,"WidthOrHeightExceedsLimit",
+          image->filename);
+      }
     layer_info[i].channels=ReadBlobShort(image);
     if (layer_info[i].channels > (unsigned short) MaxPSDChannels)
       {
@@ -2463,10 +2470,10 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
   psd_info.columns=ReadBlobMSBLong(image);
   if ((psd_info.version == 1) && ((psd_info.rows > 30000) ||
       (psd_info.columns > 30000)))
-    ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+    ThrowReaderException(ImageError,"WidthOrHeightExceedsLimit");
   if ((psd_info.version == 2) && ((psd_info.rows > 300000) ||
       (psd_info.columns > 300000)))
-    ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+    ThrowReaderException(ImageError,"WidthOrHeightExceedsLimit");
   psd_info.depth=ReadBlobMSBShort(image);
   if ((psd_info.depth != 1) && (psd_info.depth != 8) &&
       (psd_info.depth != 16) && (psd_info.depth != 32))