Commit fa3049537 for imagemagick.org

commit fa30495376bba44d29ee1f626ec6055e6c3d6fff
Author: Dirk Lemstra <dirk@lemstra.org>
Date:   Fri Oct 2 18:28:31 2026 +0200

    Correct exception that is thrown.

diff --git a/coders/png.c b/coders/png.c
index e55d7cefe..94ad30397 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -9471,7 +9471,9 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,
     {
       image_info=DestroyImageInfo(image_info);
       image=DestroyImage(image);
-      ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+      (void) ThrowMagickException(exception,GetMagickModule(),
+        ResourceLimitError,"MemoryAllocationFailed","`%s'",IMimage->filename);
+      return(MagickFalse);
     }

   ping_info=png_create_info_struct(ping);
@@ -9481,7 +9483,9 @@ static MagickBooleanType WriteOnePNGImage(MngWriteInfo *mng_info,
       image_info=DestroyImageInfo(image_info);
       image=DestroyImage(image);
       png_destroy_write_struct(&ping,(png_info **) NULL);
-      ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+      (void) ThrowMagickException(exception,GetMagickModule(),
+        ResourceLimitError,"MemoryAllocationFailed","`%s'",IMimage->filename);
+      return(MagickFalse);
     }

   png_set_write_fn(ping,image,png_put_data,png_flush_data);