From: DRC Date: Thu, 24 Feb 2011 21:16:10 +0000 (+0000) Subject: Ensure that libjpeg state is reset if an error occurs X-Git-Tag: 1.1.0~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=582a46a59eaeb92ea536d4c4df3f57e92270a0be;p=libjpeg-turbo Ensure that libjpeg state is reset if an error occurs git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@437 632fc199-4ca6-4c93-a231-07263d6284db --- diff --git a/turbojpegl.c b/turbojpegl.c index c1c62f6..7dd6a41 100644 --- a/turbojpegl.c +++ b/turbojpegl.c @@ -294,6 +294,7 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle h, -(unsigned long)(j->jdms.free_in_buffer); bailout: + if(j->cinfo.global_state>CSTATE_START) jpeg_abort_compress(&j->cinfo); if(row_pointer) free(row_pointer); for(i=0; idinfo); bailout: + if(j->dinfo.global_state>DSTATE_START) jpeg_abort_decompress(&j->dinfo); for(i=0; i