Added filename to "Invalid JPEG color components" error message in JPG loader.

Added pointer checks to CL_TextColor().
This commit is contained in:
Knightmare66 2020-04-07 23:41:08 -04:00
parent e9a777fdf7
commit 562b6c816c
2 changed files with 4 additions and 1 deletions

View file

@ -32,6 +32,9 @@ This sets the actual text color, can be called from anywhere
*/
void CL_TextColor (int colornum, int *red, int *green, int *blue)
{
if (!red || !green || !blue) // paranoia
return;
switch (colornum)
{
case 1: // red

View file

@ -1307,7 +1307,7 @@ void R_LoadJPG (char *filename, byte **pic, int *width, int *height)
// Check Color Components
if (cinfo.output_components != 3)
{
VID_Printf(PRINT_ALL, "Invalid JPEG color components\n");
VID_Printf(PRINT_ALL, "Invalid JPEG color components in %s\n", filename);
jpeg_destroy_decompress(&cinfo);
FS_FreeFile(rawdata);
return;