diff options
author | dcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2011-02-25 02:13:07 +0000 |
---|---|---|
committer | dcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2011-02-25 02:13:07 +0000 |
commit | fbe1ffe15935cde7712ea5fa0e20176218709524 (patch) | |
tree | deaaa620b0fea9529f5436c7a8bf2e168bd15f37 /branches | |
parent | 9b5387a2b0d8117b47e233f47febebee16d4a6a9 (diff) |
Fix the buffer size regression test so that it generates the intended pixel patterns
git-svn-id: https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo@450 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'branches')
-rw-r--r-- | branches/1.1.x/jpegut.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/branches/1.1.x/jpegut.c b/branches/1.1.x/jpegut.c index ea58bb4..458a679 100644 --- a/branches/1.1.x/jpegut.c +++ b/branches/1.1.x/jpegut.c @@ -547,9 +547,9 @@ void dotest1(void) { bmpbuf[i2*4]=pixels[i2%9][2]; bmpbuf[i2*4+1]=pixels[i2%9][1]; - bmpbuf[i2*2+2]=pixels[i2%9][0]; + bmpbuf[i2*4+2]=pixels[i2%9][0]; } - _catch(tjCompress(hnd, bmpbuf, i, i*4, j, 4, + _catch(tjCompress(hnd, bmpbuf, i, 0, j, 4, jpgbuf, &size, TJ_444, 100, TJ_BGR)); free(bmpbuf); bmpbuf=NULL; free(jpgbuf); jpgbuf=NULL; @@ -558,12 +558,12 @@ void dotest1(void) { printf("Memory allocation failure\n"); bailout(); } - for(i2=0; i2<j*i*4; i2++) + for(i2=0; i2<j*i; i2++) { - if(i2%2==0) bmpbuf[i2]=0xFF; - else bmpbuf[i2]=0; + if(i2%2==0) bmpbuf[i2*4]=bmpbuf[i2*4+1]=bmpbuf[i2*4+2]=0xFF; + else bmpbuf[i2*4]=bmpbuf[i2*4+1]=bmpbuf[i2*4+2]=0; } - _catch(tjCompress(hnd, bmpbuf, j, j*4, i, 4, + _catch(tjCompress(hnd, bmpbuf, j, 0, i, 4, jpgbuf, &size, TJ_444, 100, TJ_BGR)); free(bmpbuf); bmpbuf=NULL; free(jpgbuf); jpgbuf=NULL; } |