Ater compiling libjpeg and then using it, I stumbled upon the problem:
JPEG parameter struct mismatch: library thinks size is 512, caller expects 492
after which the program halts. This happens specifically with the structs struct jpeg_decompress_struct
and struct jpeg_compress_struct
. If the checks are removed on these structs, the program crashes with a null pointer exception, and the struct members contain garbage.
The error occurs with either precompiled binaries from version 6b, or with precompiled version 9a, and with the compiled version 9a; compiled with MinGW, MSYS 1.0, on windows (32 bit). Messing around in the config files does not help; the number 492
can change, but never equals 512 in order for the program to function.
The libjpeg compilation did create a valid cjpeg.exe
and djpeg.exe
.
Any ideas?
JPEG_LIB_VERSION
before the check for the size of the struct – Tepper__attribute__ ((__packed__))
attribute to the structs, so they might get packed to 492 bytes, as the caller expects. – Tepper