diff --git a/src/ImageSharp/Formats/Ani/AniDecoderCore.cs b/src/ImageSharp/Formats/Ani/AniDecoderCore.cs
index 71594b6f5..a4dfb5ca9 100644
--- a/src/ImageSharp/Formats/Ani/AniDecoderCore.cs
+++ b/src/ImageSharp/Formats/Ani/AniDecoderCore.cs
@@ -18,12 +18,12 @@ using SixLabors.ImageSharp.Metadata;
namespace SixLabors.ImageSharp.Formats.Ani;
-internal class AniDecoderCore(DecoderOptions options) : ImageDecoderCore(options)
+internal class AniDecoderCore : ImageDecoderCore
{
///
/// The general decoder options.
///
- private readonly Configuration configuration = options.Configuration;
+ private readonly Configuration configuration;
///
/// The stream to decode from.
@@ -32,6 +32,10 @@ internal class AniDecoderCore(DecoderOptions options) : ImageDecoderCore(options
private AniHeader header;
+ public AniDecoderCore(DecoderOptions options)
+ : base(options) =>
+ this.configuration = options.Configuration;
+
private enum ListIconChunkType : byte
{
Ico = 1,
diff --git a/src/ImageSharp/Formats/Icon/IconDir.cs b/src/ImageSharp/Formats/Icon/IconDir.cs
index 28681e6ea..45781295a 100644
--- a/src/ImageSharp/Formats/Icon/IconDir.cs
+++ b/src/ImageSharp/Formats/Icon/IconDir.cs
@@ -7,30 +7,37 @@ using System.Runtime.InteropServices;
namespace SixLabors.ImageSharp.Formats.Icon;
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = Size)]
-internal struct IconDir(ushort reserved, IconFileType type, ushort count)
+internal struct IconDir
{
public const int Size = 3 * sizeof(ushort);
///
/// Reserved. Must always be 0.
///
- public ushort Reserved = reserved;
+ public ushort Reserved;
///
/// Specifies image type: 1 for icon (.ICO) image, 2 for cursor (.CUR) image. Other values are invalid.
///
- public IconFileType Type = type;
+ public IconFileType Type;
///
/// Specifies number of images in the file.
///
- public ushort Count = count;
+ public ushort Count;
public IconDir(IconFileType type, ushort count = 0)
: this(0, type, count)
{
}
+ public IconDir(ushort reserved, IconFileType type, ushort count)
+ {
+ this.Reserved = reserved;
+ this.Type = type;
+ this.Count = count;
+ }
+
public static ref IconDir Parse(ReadOnlySpan data)
=> ref Unsafe.As(ref MemoryMarshal.GetReference(data));