aboutsummaryrefslogtreecommitdiff
path: root/tjunittest.c
diff options
context:
space:
mode:
authordcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2014-03-08 20:50:35 +0000
committerdcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2014-03-08 20:50:35 +0000
commitabc1021f1f3e548f8d3602cbb64254ae7c729704 (patch)
tree863f524204effbd4aa965d38e0b2c53cbc174ac9 /tjunittest.c
parent8af760c5b68197f0c72c8f4e0ac97641aabb4c12 (diff)
Silence valgrind false positives about uninitialized values. Even with this patch, valgrind still complains about uninitialized values when decompressing or decoding to a buffer with an alpha-enabled colorspace. Not sure why this happens, but it occurs in libjpeg-turbo 1.3 as well, and only when the x86/x86-64 SIMD code is being used. It is my belief that these remaining warnings are also false positives, because if the output buffer is memset to all 0's prior to invoking tjDecodeYUV()/tjDecompress(), no errors are reported. If any of the alpha channel bits were in fact not being initialized, then they would still be 0 after invoking tjDecodeYUV()/tjDecompress(), and TJUnitTest would report an error.
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1142 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'tjunittest.c')
-rw-r--r--tjunittest.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tjunittest.c b/tjunittest.c
index bdb47b1..6920ea1 100644
--- a/tjunittest.c
+++ b/tjunittest.c
@@ -417,6 +417,7 @@ void compTest(tjhandle handle, unsigned char **dstBuf,
if((yuvBuf=(unsigned char *)malloc(yuvSize))==NULL)
_throw("Memory allocation failure");
+ memset(yuvBuf, 0, yuvSize);
printf("%s %s -> YUV %s ... ", pfStr, buStrLong, subNameLong[subsamp]);
_tj(tjEncodeYUV3(handle, srcBuf, w, 0, h, pf, yuvBuf, pad, subsamp,
@@ -478,6 +479,7 @@ void _decompTest(tjhandle handle, unsigned char *jpegBuf,
if((yuvBuf=(unsigned char *)malloc(yuvSize))==NULL)
_throw("Memory allocation failure");
+ memset(yuvBuf, 0, yuvSize);
printf("JPEG -> YUV %s ", subNameLong[subsamp]);
if(sf.num!=1 || sf.denom!=1)