]> granicus.if.org Git - libjpeg-turbo/commitdiff
Fix Windows build
authorDRC <dcommander@users.sourceforge.net>
Mon, 10 Mar 2014 21:38:11 +0000 (21:38 +0000)
committerDRC <dcommander@users.sourceforge.net>
Mon, 10 Mar 2014 21:38:11 +0000 (21:38 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1147 632fc199-4ca6-4c93-a231-07263d6284db

turbojpeg.c

index ea710c94fa072c843833b3f9b6ffe683986de6e3..9117273df304e6b1d66b2352aa9e097a9cb2aa59 100644 (file)
@@ -685,13 +685,14 @@ DLLEXPORT int DLLCALL tjEncodeYUV2(tjhandle handle, unsigned char *srcBuf,
        unsigned char *rgbBuf=NULL;
        #endif
 
+       getinstance(handle);
+
        for(i=0; i<MAX_COMPONENTS; i++)
        {
                tmpbuf[i]=NULL;  _tmpbuf[i]=NULL;
                tmpbuf2[i]=NULL;  _tmpbuf2[i]=NULL;  outbuf[i]=NULL;
        }
 
-       getinstance(handle);
        if((this->init&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; i<MAX_COMPONENTS; i++)
        {
                tmpbuf[i]=NULL;  outbuf[i]=NULL;
        }
 
-       getinstance(handle);
        if((this->init&DECOMPRESS)==0)
                _throw("tjDecompressToYUV(): Instance has not been initialized for decompression");