fix a segv with icc import/export
would segv for very wide images
This commit is contained in:
parent
d6e8abce9b
commit
d739a240eb
@ -1,3 +1,6 @@
|
|||||||
|
14/5/13 started 7.32.4
|
||||||
|
- icc import and export could segv on very wide images
|
||||||
|
|
||||||
16/4/13 started 7.32.3
|
16/4/13 started 7.32.3
|
||||||
- rename GETTEXT_PACKAGE as vips7.32 to help Debian (thanks Jay)
|
- rename GETTEXT_PACKAGE as vips7.32 to help Debian (thanks Jay)
|
||||||
- added "persistent" option to tilecache
|
- added "persistent" option to tilecache
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# also update the version number in the m4 macros below
|
# also update the version number in the m4 macros below
|
||||||
|
|
||||||
AC_INIT([vips], [7.32.3], [vipsip@jiscmail.ac.uk])
|
AC_INIT([vips], [7.32.4], [vipsip@jiscmail.ac.uk])
|
||||||
# required for gobject-introspection
|
# required for gobject-introspection
|
||||||
AC_PREREQ(2.62)
|
AC_PREREQ(2.62)
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ AC_CONFIG_MACRO_DIR([m4])
|
|||||||
# user-visible library versioning
|
# user-visible library versioning
|
||||||
m4_define([vips_major_version], [7])
|
m4_define([vips_major_version], [7])
|
||||||
m4_define([vips_minor_version], [32])
|
m4_define([vips_minor_version], [32])
|
||||||
m4_define([vips_micro_version], [3])
|
m4_define([vips_micro_version], [4])
|
||||||
m4_define([vips_version],
|
m4_define([vips_version],
|
||||||
[vips_major_version.vips_minor_version.vips_micro_version])
|
[vips_major_version.vips_minor_version.vips_micro_version])
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ VIPS_VERSION_STRING=$VIPS_VERSION-`date`
|
|||||||
# binary interface changes not backwards compatible?: reset age to 0
|
# binary interface changes not backwards compatible?: reset age to 0
|
||||||
|
|
||||||
LIBRARY_CURRENT=34
|
LIBRARY_CURRENT=34
|
||||||
LIBRARY_REVISION=1
|
LIBRARY_REVISION=2
|
||||||
LIBRARY_AGE=3
|
LIBRARY_AGE=3
|
||||||
|
|
||||||
# patched into include/vips/version.h
|
# patched into include/vips/version.h
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
* - import and export cast @in to an appropriate format for you
|
* - import and export cast @in to an appropriate format for you
|
||||||
* 25/9/12
|
* 25/9/12
|
||||||
* - redo as a class
|
* - redo as a class
|
||||||
|
* 14/5/13
|
||||||
|
* - import and export would segv on very wide images
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -458,15 +460,18 @@ vips_icc_import_line( VipsColour *colour,
|
|||||||
{
|
{
|
||||||
VipsIcc *icc = (VipsIcc *) colour;
|
VipsIcc *icc = (VipsIcc *) colour;
|
||||||
|
|
||||||
VipsPel *p = (VipsPel *) in[0];
|
VipsPel *p;
|
||||||
float *q = (float *) out;
|
float *q;
|
||||||
|
int i;
|
||||||
|
|
||||||
/* Buffer of encoded 16-bit pixels we transform.
|
/* Buffer of encoded 16-bit pixels we transform.
|
||||||
*/
|
*/
|
||||||
guint16 encoded[3 * PIXEL_BUFFER_SIZE];
|
guint16 encoded[3 * PIXEL_BUFFER_SIZE];
|
||||||
|
|
||||||
while( width > 0 ) {
|
p = (VipsPel *) in[0];
|
||||||
const int chunk = VIPS_MIN( width, PIXEL_BUFFER_SIZE );
|
q = (float *) out;
|
||||||
|
for( i = 0; i < width; i += PIXEL_BUFFER_SIZE ) {
|
||||||
|
const int chunk = VIPS_MIN( width - i, PIXEL_BUFFER_SIZE );
|
||||||
|
|
||||||
#ifdef HAVE_LCMS2
|
#ifdef HAVE_LCMS2
|
||||||
cmsDoTransform( icc->trans, p, encoded, chunk );
|
cmsDoTransform( icc->trans, p, encoded, chunk );
|
||||||
@ -478,9 +483,8 @@ vips_icc_import_line( VipsColour *colour,
|
|||||||
|
|
||||||
decode_lab( encoded, q, chunk );
|
decode_lab( encoded, q, chunk );
|
||||||
|
|
||||||
p += chunk * VIPS_IMAGE_SIZEOF_PEL( colour->out );
|
p += PIXEL_BUFFER_SIZE * VIPS_IMAGE_SIZEOF_PEL( colour->in[0] );
|
||||||
q += chunk * 3;
|
q += PIXEL_BUFFER_SIZE * 3;
|
||||||
width -= chunk;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,15 +639,18 @@ vips_icc_export_line( VipsColour *colour,
|
|||||||
{
|
{
|
||||||
VipsIcc *icc = (VipsIcc *) colour;
|
VipsIcc *icc = (VipsIcc *) colour;
|
||||||
|
|
||||||
float *p = (float *) in[0];
|
float *p;
|
||||||
VipsPel *q = (VipsPel *) out;
|
VipsPel *q;
|
||||||
|
int x;
|
||||||
|
|
||||||
/* Buffer of encoded 16-bit pixels we transform.
|
/* Buffer of encoded 16-bit pixels we transform.
|
||||||
*/
|
*/
|
||||||
guint16 encoded[3 * PIXEL_BUFFER_SIZE];
|
guint16 encoded[3 * PIXEL_BUFFER_SIZE];
|
||||||
|
|
||||||
while( width > 0 ) {
|
p = (float *) in[0];
|
||||||
const int chunk = VIPS_MIN( width, PIXEL_BUFFER_SIZE );
|
q = (VipsPel *) out;
|
||||||
|
for( x = 0; x < width; x += PIXEL_BUFFER_SIZE ) {
|
||||||
|
const int chunk = VIPS_MIN( width - x, PIXEL_BUFFER_SIZE );
|
||||||
|
|
||||||
encode_lab( p, encoded, chunk );
|
encode_lab( p, encoded, chunk );
|
||||||
|
|
||||||
@ -655,9 +662,8 @@ vips_icc_export_line( VipsColour *colour,
|
|||||||
g_mutex_unlock( icc->lock );
|
g_mutex_unlock( icc->lock );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
p += chunk * 3;
|
p += PIXEL_BUFFER_SIZE * 3;
|
||||||
q += chunk * VIPS_IMAGE_SIZEOF_PEL( colour->out );
|
q += PIXEL_BUFFER_SIZE * VIPS_IMAGE_SIZEOF_PEL( colour->out );
|
||||||
width -= chunk;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user