// Load the DLL
if (! (jpeg_dll = Sys_LoadLibrary (dllname)))
{
- Con_Printf ("Can't find %s. JPEG support disabled\n", dllname);
+ Con_DPrintf("Can't find %s. JPEG support disabled\n", dllname);
return false;
}
for (func = jpegfuncs; func && func->name != NULL; func++)
if (!(*func->funcvariable = (void *) Sys_GetProcAddress (jpeg_dll, func->name)))
{
- Con_Printf ("missing function \"%s\" - broken JPEG library!\n", func->name);
+ Con_Printf("missing function \"%s\" - broken JPEG library!\n", func->name);
JPEG_CloseLibrary ();
return false;
}
- Con_Printf ("%s loaded. JPEG support enabled\n", dllname);
+ Con_DPrintf("%s loaded. JPEG support enabled\n", dllname);
return true;
}
qjpeg_destroy_decompress (&cinfo);
return NULL;
}
+ if (image_width > 4096 || image_height > 4096 || image_width <= 0 || image_height <= 0)
+ {
+ Con_Printf("JPEG_LoadImage: invalid image size %ix%i\n", image_width, image_height);
+ return NULL;
+ }
image_rgba = Mem_Alloc(tempmempool, image_width * image_height * 4);
scanline = Mem_Alloc(tempmempool, image_width * cinfo.output_components);