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
This commit is contained in:
Spoike 2006-03-14 01:17:35 +00:00
parent 66b5d2a468
commit 7f44a306f4

View file

@ -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)