JPEG library version miss match "library is 90, caller expects 80"

When ever I try to run my Qt application in release mode, the application crashes when trying to call create a QImage from jpeg data that I download. It works fine for PNGs and jpegs work just fine in debug mode.

The error happens here:

GLOBAL(void)
jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
{
...
  if (version != JPEG_LIB_VERSION)
    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
...

verision is 80 and JPEG_LIB_VERSION is 90 in the above snippet.