You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to up sample an image (232x232 px) to 300x300 px, stb_image_resize2 crashes.
The content of image does not matter, the key issue is input/output size.
If I change the output size to 302x302 px, it still crashes. But with output size as 303x303 px, no crash.
If I keep the scaling factor (i.e. 232/300) but change the size, it
still crashes when performing 464x464 -> 600x600
but does not crash when performing 387x387 -> 500x500
Crash only occurs when using the point sampling filter STBIR_FILTER_POINT_SAMPLE. I am not familiar with image processing, so is it wrong to use point sampling filter for up sampling, or I use it in a wrong form?
The stack trace from Visual Studio debugger:
stbir__horizontal_gather_4_channels_with_2_coeffs(float * output_buffer, unsigned int output_sub_size, const float * decode_buffer, const stbir__contributors * horizontal_contributors, const float * horizontal_coefficients, int coefficient_width) line 10013
stbir__resample_horizontal_gather(const stbir__info * stbir_info, float * output_buffer, const float * input_buffer) line 5992
stbir__decode_and_resample_for_vertical_gather_loop(const stbir__info * stbir_info, stbir__per_split_info * split_info, int n) line 6051
stbir__vertical_gather_loop(const stbir__info * stbir_info, stbir__per_split_info * split_info, int split_count) line 6105
stbir__perform_resize(const stbir__info * info, int split_start, int split_count) line 7089
stbir_resize_extended(STBIR_RESIZE * resize) line 7713
stbir_resize(const void * input_pixels, int input_w, int input_h, int input_stride_in_bytes, void * output_pixels, int output_w, int output_h, int output_stride_in_bytes, stbir_pixel_layout pixel_layout, stbir_datatype data_type, stbir_edge edge, stbir_filter filter) line 7883
main() line 19
To Reproduce
Steps to reproduce the behavior:
Use the stb_image_resize2.h (on commit f75e8d1cad7d90d72ef7a4661f1b994ef78b4e31)
Hmmm, the point sample filter isn't used very often (it's just for pixel art, really) - I must have a bug in there, it definitely shouldn't be using 2 coeffs. I'll look at it sometime - use STBIR_FILTER_BOX for now...
OK, I tried to use it for analysis 🤣 Before the point filter becomes available, I will use the box filter instead. Anyway, thanks for your effort in developing all these functions.
Describe the bug
When I try to up sample an image (232x232 px) to 300x300 px, stb_image_resize2 crashes.
The content of image does not matter, the key issue is input/output size.
Crash only occurs when using the point sampling filter
STBIR_FILTER_POINT_SAMPLE
. I am not familiar with image processing, so is it wrong to use point sampling filter for up sampling, or I use it in a wrong form?The stack trace from Visual Studio debugger:
To Reproduce
Steps to reproduce the behavior:
f75e8d1cad7d90d72ef7a4661f1b994ef78b4e31
)Expected behavior
The program should exit normally and return 0.
The text was updated successfully, but these errors were encountered: