diff options
author | dcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2011-02-24 21:16:10 +0000 |
---|---|---|
committer | dcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2011-02-24 21:16:10 +0000 |
commit | 108cfcd8c4aee4d970396d0843b02435b7f9580f (patch) | |
tree | 0a0d32d67aea436717d4804817e23bda3c1f0c99 /branches | |
parent | 26c36802e2139d3fb88f983eb891db5711bc62d2 (diff) |
Ensure that libjpeg state is reset if an error occurs
git-svn-id: https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo@437 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'branches')
-rw-r--r-- | branches/1.1.x/turbojpegl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/branches/1.1.x/turbojpegl.c b/branches/1.1.x/turbojpegl.c index c1c62f6..7dd6a41 100644 --- a/branches/1.1.x/turbojpegl.c +++ b/branches/1.1.x/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; i<MAX_COMPONENTS; i++) { @@ -576,6 +577,7 @@ DLLEXPORT int DLLCALL tjDecompress(tjhandle h, jpeg_finish_decompress(&j->dinfo); bailout: + if(j->dinfo.global_state>DSTATE_START) jpeg_abort_decompress(&j->dinfo); for(i=0; i<MAX_COMPONENTS; i++) { if(tmpbuf[i]) free(tmpbuf[i]); |