diff options
author | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2012-04-26 03:18:49 +0000 |
---|---|---|
committer | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2012-04-26 03:18:49 +0000 |
commit | 4bd1bd71eff87aa4aa99d479acf4fcaf4ebc1949 (patch) | |
tree | e37746ea0c33394171ffeb78c511291e88e57ca7 | |
parent | 5be451d2bb77316d3098ebb75bd6b207c785c3fb (diff) |
Fix memory leak in the colorspace emulation code
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@827 632fc199-4ca6-4c93-a231-07263d6284db
-rw-r--r-- | turbojpeg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/turbojpeg.c b/turbojpeg.c index a663509..c875fd9 100644 --- a/turbojpeg.c +++ b/turbojpeg.c @@ -639,7 +639,7 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf, bailout: if(cinfo->global_state>CSTATE_START) jpeg_abort_compress(cinfo); #ifndef JCS_EXTENSIONS - if(rgbBuf && rgbBuf!=srcBuf) free(rgbBuf); + if(rgbBuf) free(rgbBuf); #endif if(row_pointer) free(row_pointer); return retval; @@ -800,7 +800,7 @@ DLLEXPORT int DLLCALL tjEncodeYUV2(tjhandle handle, unsigned char *srcBuf, bailout: if(cinfo->global_state>CSTATE_START) jpeg_abort_compress(cinfo); #ifndef JCS_EXTENSIONS - if(rgbBuf && rgbBuf!=srcBuf) free(rgbBuf); + if(rgbBuf) free(rgbBuf); #endif if(row_pointer) free(row_pointer); for(i=0; i<MAX_COMPONENTS; i++) @@ -1018,7 +1018,7 @@ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle, unsigned char *jpegBuf, bailout: if(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo); #ifndef JCS_EXTENSIONS - if(rgbBuf && rgbBuf!=dstBuf) free(rgbBuf); + if(rgbBuf) free(rgbBuf); #endif if(row_pointer) free(row_pointer); return retval; |