From c413839e56cd3281e5ad201f61f5c4189aa50ac5 Mon Sep 17 00:00:00 2001 From: Lance Date: Mon, 3 Dec 2007 15:11:13 +0000 Subject: [PATCH] A proper fix for the setjmp bug converning non-jpeg's being passed to the jpeg library, for the "Bad number of componants in jpeg" console print. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2804 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/image.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/engine/client/image.c b/engine/client/image.c index 7c1d37285..b159e51e0 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -952,9 +952,18 @@ badjpeg: (void) jpeg_start_decompress(&cinfo); + if (cinfo.output_components == 0) + { + #ifdef _DEBUG + Con_Printf("No JPEG Components, not a JPEG.\n"); + #endif + goto badjpeg; + } if (cinfo.output_components!=3) { - Con_Printf("Bad number of components in jpeg\n"); + #ifdef _DEBUG + Con_Printf("Bad number of components in JPEG: '%d', should be '3'.\n",cinfo.output_components); + #endif goto badjpeg; } size_stride = cinfo.output_width * cinfo.output_components;