From 10cd3d514af39825d0b517ec11e7ba4023af9a96 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 29 Nov 2023 12:19:13 +1000 Subject: [PATCH] Update AnimationUtilities.cs --- src/ImageSharp/Formats/AnimationUtilities.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageSharp/Formats/AnimationUtilities.cs b/src/ImageSharp/Formats/AnimationUtilities.cs index 3c731422ad..727364227e 100644 --- a/src/ImageSharp/Formats/AnimationUtilities.cs +++ b/src/ImageSharp/Formats/AnimationUtilities.cs @@ -43,7 +43,7 @@ internal static class AnimationUtilities where TPixel : unmanaged, IPixel { MemoryAllocator memoryAllocator = configuration.MemoryAllocator; - IMemoryOwner buffers = memoryAllocator.Allocate(currentFrame.Width * 4, AllocationOptions.Clean); + using IMemoryOwner buffers = memoryAllocator.Allocate(currentFrame.Width * 4, AllocationOptions.Clean); Span previous = buffers.GetSpan()[..currentFrame.Width]; Span current = buffers.GetSpan().Slice(currentFrame.Width, currentFrame.Width); Span next = buffers.GetSpan().Slice(currentFrame.Width * 2, currentFrame.Width);