]> granicus.if.org Git - libjpeg-turbo/commitdiff
TurboJPEG: Don't make STOPONWARNING persistent
authorDRC <information@libjpeg-turbo.org>
Thu, 29 Jun 2017 17:08:02 +0000 (12:08 -0500)
committerDRC <information@libjpeg-turbo.org>
Thu, 29 Jun 2017 17:08:02 +0000 (12:08 -0500)
Due to an oversight in d4092f6b4dd94c64864662987b070d517c399490,
the state of TJFLAG_STOPONWARNING persisted beyond the function it
was passed to.

turbojpeg.c

index a22fa423f772771de9830a303ee2db982d7b782c..89c4400b0023c24b200dacc59c58aa7840468782 100644 (file)
@@ -864,6 +864,7 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, const unsigned char *srcBuf,
        #endif
        if(row_pointer) free(row_pointer);
        if(this->jerr.warning) retval=-1;
+       this->jerr.stopOnWarning=FALSE;
        return retval;
 }
 
@@ -1057,6 +1058,7 @@ DLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle,
                if(outbuf[i]!=NULL) free(outbuf[i]);
        }
        if(this->jerr.warning) retval=-1;
+       this->jerr.stopOnWarning=FALSE;
        return retval;
 }
 
@@ -1252,6 +1254,7 @@ DLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle,
        }
        if(_tmpbuf) free(_tmpbuf);
        if(this->jerr.warning) retval=-1;
+       this->jerr.stopOnWarning=FALSE;
        return retval;
 }
 
@@ -1525,6 +1528,7 @@ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle,
        #endif
        if(row_pointer) free(row_pointer);
        if(this->jerr.warning) retval=-1;
+       this->jerr.stopOnWarning=FALSE;
        return retval;
 }
 
@@ -1761,6 +1765,7 @@ DLLEXPORT int DLLCALL tjDecodeYUVPlanes(tjhandle handle,
                if(inbuf[i]!=NULL) free(inbuf[i]);
        }
        if(this->jerr.warning) retval=-1;
+       this->jerr.stopOnWarning=FALSE;
        return retval;
 }
 
@@ -1981,6 +1986,7 @@ DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle,
        }
        if(_tmpbuf) free(_tmpbuf);
        if(this->jerr.warning) retval=-1;
+       this->jerr.stopOnWarning=FALSE;
        return retval;
 }
 
@@ -2048,6 +2054,7 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
                strides, height, flags);
 
        bailout:
+       this->jerr.stopOnWarning=FALSE;
        return retval;
 
 }
@@ -2236,5 +2243,6 @@ DLLEXPORT int DLLCALL tjTransform(tjhandle handle,
        if(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);
        if(xinfo) free(xinfo);
        if(this->jerr.warning) retval=-1;
+       this->jerr.stopOnWarning=FALSE;
        return retval;
 }