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:
DRC 2011-02-25 01:14:46 +00:00
Родитель 0cc1279e03
Коммит 94476c648b
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -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)