SpaceCheetah
2 years ago
No known key found for this signature in database
GPG Key ID: A60F20D29141DFF9
1 changed files with
2 additions and
1 deletions
-
src/ImageSharp/Formats/Png/PngDecoderCore.cs
|
|
|
@ -648,7 +648,8 @@ internal sealed class PngDecoderCore : IImageDecoderInternals |
|
|
|
{ |
|
|
|
frame = image.Frames.AddFrame(previousFrame ?? image.Frames.RootFrame); |
|
|
|
|
|
|
|
// If restoring to before first frame, restore to background. Same if first frame (previousFrameControl null).
|
|
|
|
// If the first `fcTL` chunk uses a `dispose_op` of APNG_DISPOSE_OP_PREVIOUS it should be treated as APNG_DISPOSE_OP_BACKGROUND.
|
|
|
|
// So, if restoring to before first frame, clear entire area. Same if first frame (previousFrameControl null).
|
|
|
|
if (previousFrameControl == null || (previousFrame is null && previousFrameControl.Value.DisposeOperation == PngDisposalMethod.RestoreToPrevious)) |
|
|
|
{ |
|
|
|
Buffer2DRegion<TPixel> pixelRegion = frame.PixelBuffer.GetRegion(); |
|
|
|
|