Closed aras-p closed 4 months ago
I will scope this out, this weekend!
Also, I should probably eventually special case 16x16 and smaller downsamples - that could probably be quite a bit faster without going through all the general machinery. Although these are already fast, I suppose.
I wouldn't bother special-casing them; it's hard to imagine a scenario where they'd be a critical path if they're already reasonably fast.
OK, fixed in #1603
Fixed by #1605.
Describe the bug When resizing very small images (like 2x2 into 1x1) with
STBIR_EDGE_WRAP
andSTBIR_FILTER_DEFAULT
, there's a debug assert and a possible later crash.stb_image_resize2.h version v2.04.
To Reproduce
This code:
Triggers
STBIR_ASSERT( info->ring_buffer_num_entries <= info->alloc_ring_buffer_num_entries );
at line 7028.info->ring_buffer_num_entries
is 6,info->alloc_ring_buffer_num_entries
is 5.Changing wrap mode to clamp, or filter to box does not trigger the assert/crash.
Expected behavior I'd expect no asserts and no crashes.