diff --git a/turbojpeg.c b/turbojpeg.c index ea710c94..9117273d 100644 --- a/turbojpeg.c +++ b/turbojpeg.c @@ -685,13 +685,14 @@ DLLEXPORT int DLLCALL tjEncodeYUV2(tjhandle handle, unsigned char *srcBuf, unsigned char *rgbBuf=NULL; #endif + getinstance(handle); + for(i=0; iinit&COMPRESS)==0) _throw("tjEncodeYUV2(): Instance has not been initialized for compression"); @@ -1057,12 +1058,13 @@ DLLEXPORT int DLLCALL tjDecompressToYUV(tjhandle handle, tmpbufsize=0, usetmpbuf=0, th[MAX_COMPONENTS]; JSAMPLE *_tmpbuf=NULL, *ptr=dstBuf; JSAMPROW *tmpbuf[MAX_COMPONENTS]; + getinstance(handle); + for(i=0; iinit&DECOMPRESS)==0) _throw("tjDecompressToYUV(): Instance has not been initialized for decompression");