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
This commit is contained in:
@@ -294,6 +294,7 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle h,
|
|||||||
-(unsigned long)(j->jdms.free_in_buffer);
|
-(unsigned long)(j->jdms.free_in_buffer);
|
||||||
|
|
||||||
bailout:
|
bailout:
|
||||||
|
if(j->cinfo.global_state>CSTATE_START) jpeg_abort_compress(&j->cinfo);
|
||||||
if(row_pointer) free(row_pointer);
|
if(row_pointer) free(row_pointer);
|
||||||
for(i=0; i<MAX_COMPONENTS; i++)
|
for(i=0; i<MAX_COMPONENTS; i++)
|
||||||
{
|
{
|
||||||
@@ -576,6 +577,7 @@ DLLEXPORT int DLLCALL tjDecompress(tjhandle h,
|
|||||||
jpeg_finish_decompress(&j->dinfo);
|
jpeg_finish_decompress(&j->dinfo);
|
||||||
|
|
||||||
bailout:
|
bailout:
|
||||||
|
if(j->dinfo.global_state>DSTATE_START) jpeg_abort_decompress(&j->dinfo);
|
||||||
for(i=0; i<MAX_COMPONENTS; i++)
|
for(i=0; i<MAX_COMPONENTS; i++)
|
||||||
{
|
{
|
||||||
if(tmpbuf[i]) free(tmpbuf[i]);
|
if(tmpbuf[i]) free(tmpbuf[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user