aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDRC <information@libjpeg-turbo.org>2015-08-26 20:29:36 -0500
committerDRC <information@libjpeg-turbo.org>2015-08-26 20:29:36 -0500
commit58ae401e503ac61babb9d66be8fc06bfb0445dbf (patch)
tree9f86955344a1827c61a85d955543d824ee9718ac
parent6709e4a0cfa44d4f54ee8ad05753d4aa9260cb91 (diff)
downloadlibjpeg-turbo-58ae401e503ac61babb9d66be8fc06bfb0445dbf.tar.gz
Eliminate cppcheck false positive in turbojpeg.c
-rw-r--r--turbojpeg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/turbojpeg.c b/turbojpeg.c
index 5ba9a19b..6b2c6232 100644
--- a/turbojpeg.c
+++ b/turbojpeg.c
@@ -1381,7 +1381,7 @@ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle, unsigned char *jpegBuf,
if(scaledw<=width && scaledh<=height)
break;
}
- if(scaledw>width || scaledh>height)
+ if(i>=NUMSF)
_throw("tjDecompress2(): Could not scale down to desired image dimensions");
width=scaledw; height=scaledh;
dinfo->scale_num=sf[i].num;
@@ -1756,7 +1756,7 @@ DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle,
if(scaledw<=width && scaledh<=height)
break;
}
- if(scaledw>width || scaledh>height)
+ if(i>=NUMSF)
_throw("tjDecompressToYUVPlanes(): Could not scale down to desired image dimensions");
if(dinfo->num_components>3)
_throw("tjDecompressToYUVPlanes(): JPEG image must have 3 or fewer components");
@@ -1902,7 +1902,7 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
if(scaledw<=width && scaledh<=height)
break;
}
- if(scaledw>width || scaledh>height)
+ if(i>=NUMSF)
_throw("tjDecompressToYUV2(): Could not scale down to desired image dimensions");
pw0=tjPlaneWidth(0, width, jpegSubsamp);