Browse Source

Fixed: Addressed a potential null reference exception in the SvgImage object’s finalizer that could lead to application crashes when handling invalid SVG content.

Marcin Ziąbek 1 year ago
parent
commit
e987a38361

+ 2 - 2
Source/QuestPDF/Infrastructure/Image.cs

@@ -42,10 +42,10 @@ namespace QuestPDF.Infrastructure
         
         ~Image()
         {
-            SkImage.Dispose();
+            SkImage?.Dispose();
             
             foreach (var cacheKey in ScaledImageCache)
-                cacheKey.image.Dispose();
+                cacheKey.image?.Dispose();
         }
         
         #region Scaling Image

+ 1 - 1
Source/QuestPDF/Infrastructure/SvgImage.cs

@@ -23,7 +23,7 @@ public class SvgImage
 
     ~SvgImage()
     {
-        SkSvgImage.Dispose();
+        SkSvgImage?.Dispose();
     }
     
     /// <summary>

+ 3 - 3
Source/QuestPDF/Resources/ReleaseNotes.txt

@@ -45,8 +45,8 @@ Version 2024.3.2
 
 
 Version 2024.3.3
+- Improved the default scaling behavior of Image and SvgImage elements when they are direct descendants of the Constrained element (Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight).
+- Enhanced handling of texts containing the carriage return character '\r' within the custom page format setting.
 - Fixed: enhanced the handling of the TextStyle.LineHeight modifier for better consistency with industry-standard software, as well as adjusted the default value.
 - Fixed: when the UseEnvironmentFonts setting is enabled, the Lato font was not being properly registered. This issue could lead to runtime exceptions in specific minimal environments.
-- Enhanced handling of texts containing the carriage return character '\r' within the custom page format setting.
-- Improved the default scaling behavior of Image and SvgImage elements when they are direct descendants of the Constrained element (Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight).
-
+- Fixed: Addressed a potential null reference exception in the SvgImage object’s finalizer that could lead to application crashes when handling invalid SVG content.