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: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@446 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
@@ -79,10 +79,9 @@ void dotest(unsigned char *srcbuf, int w, int h, int pf, int bu,
|
|||||||
|
|
||||||
flags |= _flags[pf];
|
flags |= _flags[pf];
|
||||||
if(bu) flags |= TJ_BOTTOMUP;
|
if(bu) flags |= TJ_BOTTOMUP;
|
||||||
if(yuv==YUVENCODE) flags |= TJ_YUV;
|
|
||||||
|
|
||||||
yuvsize=TJBUFSIZEYUV(w, h, jpegsub);
|
if(yuv==YUVENCODE) yuvsize=TJBUFSIZEYUV(w, h, jpegsub);
|
||||||
if((rgbbuf=(unsigned char *)malloc(max(yuvsize, pitch*h))) == NULL)
|
if((rgbbuf=(unsigned char *)malloc(max(yuvsize, pitch*h+1))) == NULL)
|
||||||
_throwunix("allocating image buffer");
|
_throwunix("allocating image buffer");
|
||||||
|
|
||||||
if(!quiet)
|
if(!quiet)
|
||||||
|
|||||||
Reference in New Issue
Block a user