|
|
|
@ -197,18 +197,13 @@ internal sealed class PngDecoderCore : ImageDecoderCore |
|
|
|
break; |
|
|
|
case PngChunkType.FrameControl: |
|
|
|
frameCount++; |
|
|
|
if (frameCount == this.maxFrames) |
|
|
|
{ |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
currentFrame = null; |
|
|
|
currentFrameControl = this.ReadFrameControlChunk(chunk.Data.GetSpan()); |
|
|
|
break; |
|
|
|
case PngChunkType.FrameData: |
|
|
|
if (frameCount == this.maxFrames) |
|
|
|
if (frameCount >= this.maxFrames) |
|
|
|
{ |
|
|
|
break; |
|
|
|
goto EOF; |
|
|
|
} |
|
|
|
|
|
|
|
if (image is null) |
|
|
|
@ -264,6 +259,11 @@ internal sealed class PngDecoderCore : ImageDecoderCore |
|
|
|
previousFrameControl = currentFrameControl; |
|
|
|
} |
|
|
|
|
|
|
|
if (frameCount >= this.maxFrames) |
|
|
|
{ |
|
|
|
goto EOF; |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
case PngChunkType.Palette: |
|
|
|
this.palette = chunk.Data.GetSpan().ToArray(); |
|
|
|
@ -382,7 +382,7 @@ internal sealed class PngDecoderCore : ImageDecoderCore |
|
|
|
break; |
|
|
|
case PngChunkType.FrameControl: |
|
|
|
++frameCount; |
|
|
|
if (frameCount == this.maxFrames) |
|
|
|
if (frameCount >= this.maxFrames) |
|
|
|
{ |
|
|
|
break; |
|
|
|
} |
|
|
|
@ -390,7 +390,7 @@ internal sealed class PngDecoderCore : ImageDecoderCore |
|
|
|
lastFrameControl = this.ReadFrameControlChunk(chunk.Data.GetSpan()); |
|
|
|
break; |
|
|
|
case PngChunkType.FrameData: |
|
|
|
if (frameCount == this.maxFrames) |
|
|
|
if (frameCount >= this.maxFrames) |
|
|
|
{ |
|
|
|
break; |
|
|
|
} |
|
|
|
|