]> granicus.if.org Git - libjpeg-turbo/commitdiff
TurboJPEG C: Compiler warnings
authorDRC <information@libjpeg-turbo.org>
Wed, 20 Sep 2017 19:55:54 +0000 (19:55 +0000)
committerDRC <information@libjpeg-turbo.org>
Wed, 20 Sep 2017 19:59:21 +0000 (19:59 +0000)
Introduced in b9ab64d8dbee2db829e59357d335c151680f44f0.

turbojpeg.c

index 89c4400b0023c24b200dacc59c58aa7840468782..ebdced7d8a3a9dda979823188fddb185f7bd7717 100644 (file)
@@ -1068,8 +1068,10 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle,
 {
        unsigned char *dstPlanes[3];
        int pw0, ph0, strides[3], retval=-1;
+       tjinstance *this=(tjinstance *)handle;
 
-       getcinstance(handle);
+       if(!this) _throwg("tjEncodeYUV3(): Invalid handle");
+       this->isInstanceError=FALSE;
 
        if(width<=0 || height<=0 || dstBuf==NULL || pad<0 || !isPow2(pad)
                || subsamp<0 || subsamp>=NUMSUBOPT)
@@ -1264,8 +1266,10 @@ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle,
 {
        const unsigned char *srcPlanes[3];
        int pw0, ph0, strides[3], retval=-1;
+       tjinstance *this=(tjinstance *)handle;
 
-       getcinstance(handle);
+       if(!this) _throwg("tjCompressFromYUV(): Invalid handle");
+       this->isInstanceError=FALSE;
 
        if(srcBuf==NULL || width<=0 || pad<1 || height<=0 || subsamp<0
                || subsamp>=NUMSUBOPT)
@@ -1775,8 +1779,10 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, const unsigned char *srcBuf,
 {
        const unsigned char *srcPlanes[3];
        int pw0, ph0, strides[3], retval=-1;
+       tjinstance *this=(tjinstance *)handle;
 
-       getdinstance(handle);
+       if(!this) _throwg("tjDecodeYUV(): Invalid handle");
+       this->isInstanceError=FALSE;
 
        if(srcBuf==NULL || pad<0 || !isPow2(pad) || subsamp<0 || subsamp>=NUMSUBOPT
                || width<=0 || height<=0)