Cykooz / fast_image_resize

Rust library for fast image resizing with using of SIMD instructions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

valgrind memcheck detects reads of unitialized memory memory

Farmadupe opened this issue · comments

While debugging an (unrelated) memory leak in my own code using valgrind's memcheck tool, the following error was reported in this library.

Unfortunately I'm not quite in a state to be able to share some code to reproduce this error, but hopefully the output from memcheck will help

==1102663== Use of uninitialised value of size 8
==1102663== at 0x3D3A64: fast_image_resize::convolution::u8x1::::horiz_convolution (optimisations.rs:113)
==1102663== by 0x3E72A3: fast_image_resize::resizer::resample_convolution (resizer.rs:285)
==1102663== by 0x3E3B95: fast_image_resize::resizer::Resizer::resize (resizer.rs:0)
==1102663== by 0x3B2C9F: vid_dup_finder_common::video_frames_gray::crop_resize_frame (video_frames_gray.rs:382)

I have created a snippet of my calling code: https://gist.github.com/Farmadupe/c88f5d526331163f2741354d83fa1f9d

The resize filter is Lanczos3.

If image dimensions are important, the unitialized read occurs when called with the following arguments:
src_dimensions: 1280x720, src_crop: (left: 0, top: 0, width: 1280, height: 720), new_dimensions: 64x64
src_dimensions: 1280x720, src_crop: (left: 0, top: 80, width: 1280, height: 612), new_dimensions: 64x64

Could you please attach an example of the source image? I can't reproduce this error with my test images.

Apologies for the very long delay. This issue was raised in error, and was caused due to memory alignment issues in my own code.