@@ -119,7 +119,7 @@ internal sealed class PngDecoderCore : ImageDecoderCore
119119 /// <summary>
120120 /// How to handle CRC errors.
121121 /// </summary>
122- private readonly PngCrcChunkHandling pngCrcChunkHandling ;
122+ private readonly SegmentIntegrityHandling segmentIntegrityHandling ;
123123
124124 /// <summary>
125125 /// A reusable Crc32 hashing instance.
@@ -142,7 +142,7 @@ public PngDecoderCore(PngDecoderOptions options)
142142 this . maxFrames = options . GeneralOptions . MaxFrames ;
143143 this . skipMetadata = options . GeneralOptions . SkipMetadata ;
144144 this . memoryAllocator = this . configuration . MemoryAllocator ;
145- this . pngCrcChunkHandling = options . PngCrcChunkHandling ;
145+ this . segmentIntegrityHandling = options . GeneralOptions . SegmentIntegrityHandling ;
146146 this . maxUncompressedLength = options . MaxUncompressedAncillaryChunkSizeBytes ;
147147 }
148148
@@ -154,7 +154,7 @@ internal PngDecoderCore(PngDecoderOptions options, bool colorMetadataOnly)
154154 this . skipMetadata = true ;
155155 this . configuration = options . GeneralOptions . Configuration ;
156156 this . memoryAllocator = this . configuration . MemoryAllocator ;
157- this . pngCrcChunkHandling = options . PngCrcChunkHandling ;
157+ this . segmentIntegrityHandling = options . GeneralOptions . SegmentIntegrityHandling ;
158158 this . maxUncompressedLength = options . MaxUncompressedAncillaryChunkSizeBytes ;
159159 }
160160
@@ -833,7 +833,7 @@ private void DecodePixelData<TPixel>(
833833 break ;
834834
835835 default :
836- if ( this . pngCrcChunkHandling is PngCrcChunkHandling . IgnoreData or PngCrcChunkHandling . IgnoreAll )
836+ if ( this . segmentIntegrityHandling is SegmentIntegrityHandling . IgnoreData or SegmentIntegrityHandling . IgnoreAll )
837837 {
838838 goto EXIT ;
839839 }
@@ -939,7 +939,7 @@ private void DecodeInterlacedPixelData<TPixel>(
939939 break ;
940940
941941 default :
942- if ( this . pngCrcChunkHandling is PngCrcChunkHandling . IgnoreData or PngCrcChunkHandling . IgnoreAll )
942+ if ( this . segmentIntegrityHandling is SegmentIntegrityHandling . IgnoreData or SegmentIntegrityHandling . IgnoreAll )
943943 {
944944 goto EXIT ;
945945 }
@@ -1927,7 +1927,7 @@ private bool TryReadChunk(Span<byte> buffer, out PngChunk chunk)
19271927 private void ValidateChunk ( in PngChunk chunk , Span < byte > buffer )
19281928 {
19291929 uint inputCrc = this . ReadChunkCrc ( buffer ) ;
1930- if ( chunk . IsCritical ( this . pngCrcChunkHandling ) )
1930+ if ( chunk . IsCritical ( this . segmentIntegrityHandling ) )
19311931 {
19321932 Span < byte > chunkType = stackalloc byte [ 4 ] ;
19331933 BinaryPrimitives . WriteUInt32BigEndian ( chunkType , ( uint ) chunk . Type ) ;
0 commit comments