diff options
author | dcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2011-02-25 01:14:46 +0000 |
---|---|---|
committer | dcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2011-02-25 01:14:46 +0000 |
commit | f0ec92ed75d8304158ec6058eb99bca43e5fec56 (patch) | |
tree | 7c1466610de5a146584ae6faa1cd63850bb8aeee /branches | |
parent | c93de78928c15ba5aaa2b5141e7ada7b47092531 (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.c | 5 |
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) |