From 7f44a306f4847aef2a751a57f0e2b07774ecb603 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 14 Mar 2006 01:17:35 +0000 Subject: [PATCH] TimeServ wanted me to get rid of a Sys_Error in the jpeg loader. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2109 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/image.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/client/image.c b/engine/client/image.c index d11b43e85..86fefb02d 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -925,6 +925,8 @@ qbyte *ReadJPEGFile(qbyte *infile, int length, int *width, int *height) if (setjmp(jerr.setjmp_buffer)) { // If we get here, the JPEG code has signaled an error. +badjpeg: + jpeg_destroy_decompress(&cinfo); if (mem) @@ -941,7 +943,10 @@ qbyte *ReadJPEGFile(qbyte *infile, int length, int *width, int *height) if (cinfo.output_components!=3) - Sys_Error("Bad number of componants in jpeg"); + { + Con_Printf("Bad number of componants in jpeg"); + goto badjpeg; + } size_stride = cinfo.output_width * cinfo.output_components; /* Make a one-row-high sample array that will go away when done with image */ buffer = (*cinfo.mem->alloc_sarray)