Skip to content

Commit 8adcabe

Browse files
Use >= to compare.
1 parent 2f3d24d commit 8adcabe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ImageSharp/Formats/Png/PngDecoderCore.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public Image<TPixel> Decode<TPixel>(BufferedReadStream stream, CancellationToken
208208
currentFrameControl = this.ReadFrameControlChunk(chunk.Data.GetSpan());
209209
break;
210210
case PngChunkType.FrameData:
211-
if (frameCount == this.maxFrames)
211+
if (frameCount >= this.maxFrames)
212212
{
213213
goto EOF;
214214
}
@@ -266,7 +266,7 @@ public Image<TPixel> Decode<TPixel>(BufferedReadStream stream, CancellationToken
266266
previousFrameControl = currentFrameControl;
267267
}
268268

269-
if (frameCount == this.maxFrames)
269+
if (frameCount >= this.maxFrames)
270270
{
271271
goto EOF;
272272
}
@@ -389,15 +389,15 @@ public ImageInfo Identify(BufferedReadStream stream, CancellationToken cancellat
389389
break;
390390
case PngChunkType.FrameControl:
391391
++frameCount;
392-
if (frameCount == this.maxFrames)
392+
if (frameCount >= this.maxFrames)
393393
{
394394
break;
395395
}
396396

397397
lastFrameControl = this.ReadFrameControlChunk(chunk.Data.GetSpan());
398398
break;
399399
case PngChunkType.FrameData:
400-
if (frameCount == this.maxFrames)
400+
if (frameCount >= this.maxFrames)
401401
{
402402
break;
403403
}

0 commit comments

Comments
 (0)