Skip to content

Commit

Permalink
Merge pull request #1947 from SixLabors/af/fix-1625
Browse files Browse the repository at this point in the history
Ensure ResizeProcessor working buffer is contiguous
  • Loading branch information
antonfirsov authored Jan 21, 2022
2 parents 669c900 + 1699a75 commit 3ca5c37
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public ResizeWorker(
this.transposedFirstPassBuffer = configuration.MemoryAllocator.Allocate2D<Vector4>(
this.workerHeight,
destWidth,
AllocationOptions.Clean);
preferContiguosImageBuffers: true,
options: AllocationOptions.Clean);

this.tempRowBuffer = configuration.MemoryAllocator.Allocate<Vector4>(this.sourceRectangle.Width);
this.tempColumnBuffer = configuration.MemoryAllocator.Allocate<Vector4>(destWidth);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,5 +669,17 @@ public void Issue1342(int width, int height)
Assert.Equal(height, image.Height);
}
}

[Theory]
[WithBasicTestPatternImages(20, 20, PixelTypes.Rgba32)]
public void Issue1625_LimitedAllocator<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
provider.LimitAllocatorBufferCapacity().InBytes(1000);
provider.RunValidatingProcessorTest(
x => x.Resize(30, 30),
appendPixelTypeToFileName: false,
appendSourceFileOrDescription: false);
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3ca5c37

Please sign in to comment.