From 388f8743feebc0bf84695e9c468de39d1c795f40 Mon Sep 17 00:00:00 2001 From: dcommander Date: Tue, 15 Mar 2011 20:09:47 +0000 Subject: tjTransform() was not working properly if r.w=0 or r.h=0 git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@517 632fc199-4ca6-4c93-a231-07263d6284db --- turbojpeg.h | 4 ++-- turbojpegl.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/turbojpeg.h b/turbojpeg.h index b6a9d91..e075277 100644 --- a/turbojpeg.h +++ b/turbojpeg.h @@ -475,9 +475,9 @@ DLLEXPORT tjhandle DLLCALL tjInitTransform(void); divisible by tjmcuh[subsamp] (the MCU block height corresponding to the level of chrominance subsampling used in the source image) r.w = the width of the cropping region. Setting this to 0 is the - equivalent of setting it to the width of the source JPEG image. + equivalent of setting it to the width of the source JPEG image - r.x. r.h = the height of the cropping region. Setting this to 0 is the - equivalent of setting it to the height of the source JPEG image. + equivalent of setting it to the height of the source JPEG image - r.y. op = one of the transform operations described in the "Transform operations" section above options = the bitwise OR of one or more of the transform options described diff --git a/turbojpegl.c b/turbojpegl.c index 2a35e2f..266e335 100644 --- a/turbojpegl.c +++ b/turbojpegl.c @@ -743,6 +743,7 @@ DLLEXPORT int DLLCALL tjTransform(tjhandle hnd, if((xinfo=(jpeg_transform_info *)malloc(sizeof(jpeg_transform_info)*n)) ==NULL) _throw("Memory allocation failed in tjTransform()"); + memset(xinfo, 0, sizeof(jpeg_transform_info)*n); for(i=0; i