mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 22:01:50 +00:00
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:
parent
66b5d2a468
commit
7f44a306f4
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue