Open ThomasdenH opened 5 years ago
pos < height * width
pos + 1 !< height * width
Maybe:
int hw, pos;
hw = height * width;
for (pos = 0; pos < (hw - 1); pos++)
{
(*hash)[pos] = (image[pos] < image[pos + 1]);
}
(*hash)[hw - 1] = (image[hw - 1] < image[0]);
Not?
I will add one more such "miss", but already "from the side": https://github.com/danielgtaylor/jpeg-archive/blob/8da4bf76b6c3c0e11e4941294bfc1857c119419b/src/smallfry.c#L74-L81 to:
for (j = 7; j < width - 2; j += 8) {
for (i = 7; i < height - 2; i += 8) {
See https://github.com/ImageProcessing-ElectronicPublications/libsmallfry
Compiling with
CFLAGS="-fsanitize=address"
will reliably crashjpeg-hash
with the following image file: