aboutsummaryrefslogtreecommitdiff
path: root/turbojpegl.c
diff options
context:
space:
mode:
Diffstat (limited to 'turbojpegl.c')
-rw-r--r--turbojpegl.c3
1 files changed, 3 insertions, 0 deletions
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<n; i++)
{
@@ -762,10 +763,12 @@ DLLEXPORT int DLLCALL tjTransform(tjhandle hnd,
{
xinfo[i].crop_width=t[i].r.w; xinfo[i].crop_width_set=JCROP_POS;
}
+ else xinfo[i].crop_width=JCROP_UNSET;
if(t[i].r.h!=0)
{
xinfo[i].crop_height=t[i].r.h; xinfo[i].crop_height_set=JCROP_POS;
}
+ else xinfo[i].crop_height=JCROP_UNSET;
}
}