veluca93 / fpnge

Demo of a fast PNG encoder.
Apache License 2.0
81 stars 8 forks source link

double free or corruption (!prev) with avx2 #13

Closed wwww-wwww closed 2 years ago

wwww-wwww commented 2 years ago

test2

imagedata.zip width 460 height 460 num_channels 4 bytes_per_channel 1

animetosho commented 2 years ago

Ack, looks like I messed up the alignment code.

You can fix this by changing the following line in fpnge.cc:

std::vector<unsigned char> pdata_buf(bytes_per_line_buf);

and replacing it with

std::vector<unsigned char> pdata_buf(bytes_per_line_buf + SIMD_WIDTH - 1);

Thanks for reporting!