Skip to content

Commit

Permalink
Use >= to compare.
Browse files Browse the repository at this point in the history
  • Loading branch information
JimBobSquarePants committed Jul 15, 2024
1 parent 2f3d24d commit 8adcabe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ImageSharp/Formats/Png/PngDecoderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public Image<TPixel> Decode<TPixel>(BufferedReadStream stream, CancellationToken
currentFrameControl = this.ReadFrameControlChunk(chunk.Data.GetSpan());
break;
case PngChunkType.FrameData:
if (frameCount == this.maxFrames)
if (frameCount >= this.maxFrames)
{
goto EOF;
}
Expand Down Expand Up @@ -266,7 +266,7 @@ public Image<TPixel> Decode<TPixel>(BufferedReadStream stream, CancellationToken
previousFrameControl = currentFrameControl;
}

if (frameCount == this.maxFrames)
if (frameCount >= this.maxFrames)
{
goto EOF;
}
Expand Down Expand Up @@ -389,15 +389,15 @@ public ImageInfo Identify(BufferedReadStream stream, CancellationToken cancellat
break;
case PngChunkType.FrameControl:
++frameCount;
if (frameCount == this.maxFrames)
if (frameCount >= this.maxFrames)
{
break;
}

lastFrameControl = this.ReadFrameControlChunk(chunk.Data.GetSpan());
break;
case PngChunkType.FrameData:
if (frameCount == this.maxFrames)
if (frameCount >= this.maxFrames)
{
break;
}
Expand Down

0 comments on commit 8adcabe

Please sign in to comment.