summaryrefslogtreecommitdiff
path: root/branches
diff options
context:
space:
mode:
authordcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519>2011-02-25 01:14:46 +0000
committerdcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519>2011-02-25 01:14:46 +0000
commitf0ec92ed75d8304158ec6058eb99bca43e5fec56 (patch)
tree7c1466610de5a146584ae6faa1cd63850bb8aeee /branches
parentc93de78928c15ba5aaa2b5141e7ada7b47092531 (diff)
Only access TJBUFSIZEYUV symbol if YUV encoding is enabled, and add 1 to the buffer size; This allows jpgtest to be used to benchmark the old TurboJPEG/IPP libraries.
git-svn-id: https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo@446 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'branches')
-rw-r--r--branches/1.1.x/jpgtest.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/branches/1.1.x/jpgtest.c b/branches/1.1.x/jpgtest.c
index e514733..80ac42e 100644
--- a/branches/1.1.x/jpgtest.c
+++ b/branches/1.1.x/jpgtest.c
@@ -79,10 +79,9 @@ void dotest(unsigned char *srcbuf, int w, int h, int pf, int bu,
flags |= _flags[pf];
if(bu) flags |= TJ_BOTTOMUP;
- if(yuv==YUVENCODE) flags |= TJ_YUV;
- yuvsize=TJBUFSIZEYUV(w, h, jpegsub);
- if((rgbbuf=(unsigned char *)malloc(max(yuvsize, pitch*h))) == NULL)
+ if(yuv==YUVENCODE) yuvsize=TJBUFSIZEYUV(w, h, jpegsub);
+ if((rgbbuf=(unsigned char *)malloc(max(yuvsize, pitch*h+1))) == NULL)
_throwunix("allocating image buffer");
if(!quiet)