I was using an incompatible version of libjpeg-8c. We will either need to use the rgba-patched version or update the code to work correctly with vanilla. I vote for the latter, since it will make porting easier...
JPEG handling, replace IJL with the jpeg library from IJG, unless IJL_SDK_AVAILABLE is defined.