diff --git a/common/turbojpeg.c b/common/turbojpeg.c index c145338..11168a2 100644 --- a/common/turbojpeg.c +++ b/common/turbojpeg.c @@ -601,7 +601,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; @@ -835,7 +835,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;