Merge branch 'master' into add-webp-animated

This commit is contained in:
John Cupitt 2018-11-26 13:20:34 +00:00
commit 1d64321649
3 changed files with 14 additions and 5 deletions

View File

@ -939,8 +939,14 @@ vips_line_cache_build( VipsObject *object )
/* Output has two buffers n_lines height, so 2 * n_lines is the maximum
* non-locality from threading. Add another n_lines for conv / reducev
* etc.
*
* tile_height can be huge for things like tiff read, where we can
* have a whole strip in a single tile ... we still need to have a
* minimum of two strips, so we can handle requests that straddle a
* tile boundary.
*/
block_cache->max_tiles = 3 * n_lines / block_cache->tile_height;
block_cache->max_tiles = VIPS_MAX( 2,
3 * n_lines / block_cache->tile_height );
VIPS_DEBUG_MSG( "vips_line_cache_build: n_lines = %d\n",
n_lines );

View File

@ -2049,6 +2049,9 @@ rtiff_read_stripwise( Rtiff *rtiff, VipsImage *out )
}
/* rows_per_strip can be very large if this is a separate plane image,
* beware.
*/
if(
vips_image_generate( t[0],
NULL, rtiff_stripwise_generate, NULL,
@ -2059,7 +2062,6 @@ rtiff_read_stripwise( Rtiff *rtiff, VipsImage *out )
rtiff_autorotate( rtiff, t[1], &t[2] ) ||
rtiff_unpremultiply( rtiff, t[2], &t[3] ) ||
vips_image_write( t[3], out ) )
return( -1 );
return( 0 );

View File

@ -275,11 +275,12 @@ vips_buf_appendns( VipsBuf *buf, const char *str, int sz )
*/
avail = buf->mx - buf->i - 4;
/* Amount we actually copy.
*/
cpy = VIPS_MIN( n, avail );
vips_strncpy( buf->base + buf->i, str, cpy );
/* Can't use vips_strncpy() here, we don't want to drop the end of the
* string.
*/
strncpy( buf->base + buf->i, str, cpy );
buf->i += cpy;
if( buf->i >= buf->mx - 4 ) {