Browse Source

Update AnimationUtilities.cs

pull/2588/head
James Jackson-South 3 years ago
parent
commit
10cd3d514a
  1. 2
      src/ImageSharp/Formats/AnimationUtilities.cs

2
src/ImageSharp/Formats/AnimationUtilities.cs

@ -43,7 +43,7 @@ internal static class AnimationUtilities
where TPixel : unmanaged, IPixel<TPixel>
{
MemoryAllocator memoryAllocator = configuration.MemoryAllocator;
IMemoryOwner<Rgba32> buffers = memoryAllocator.Allocate<Rgba32>(currentFrame.Width * 4, AllocationOptions.Clean);
using IMemoryOwner<Rgba32> buffers = memoryAllocator.Allocate<Rgba32>(currentFrame.Width * 4, AllocationOptions.Clean);
Span<Rgba32> previous = buffers.GetSpan()[..currentFrame.Width];
Span<Rgba32> current = buffers.GetSpan().Slice(currentFrame.Width, currentFrame.Width);
Span<Rgba32> next = buffers.GetSpan().Slice(currentFrame.Width * 2, currentFrame.Width);

Loading…
Cancel
Save