From e4b31dde38aa25c6c1ca9a68fa91e55426a54f91 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 27 Jan 2016 12:44:36 +0000 Subject: [PATCH] fix labq sparc read byteswap was swapping coded images, or trying to --- ChangeLog | 3 +++ libvips/conversion/byteswap.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 79a20cd4..7a69d216 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +27/1/16 started 8.2.3 +- fix a crash with SPARC byte-order labq vips images + 12/1/16 started 8.2.2 - changes to ease compiling C++ binding with MSVC [Lovell Fuller] - reorder file tests to put slow loaders last diff --git a/libvips/conversion/byteswap.c b/libvips/conversion/byteswap.c index f2124018..1d29d9e2 100644 --- a/libvips/conversion/byteswap.c +++ b/libvips/conversion/byteswap.c @@ -2,6 +2,8 @@ * * 5/6/15 * - from copy.c + * 27/1/16 + * - don't swap coded images */ /* @@ -137,6 +139,8 @@ vips_byteswap_gen( VipsRegion *or, int y; + g_assert( swap ); + if( vips_region_prepare( ir, r ) ) return( -1 ); @@ -159,6 +163,12 @@ vips_byteswap_build( VipsObject *object ) if( VIPS_OBJECT_CLASS( vips_byteswap_parent_class )->build( object ) ) return( -1 ); + /* Lots of images don't need swapping. + */ + if( byteswap->in->Coding != VIPS_CODING_NONE || + !vips_byteswap_swap_fn[byteswap->in->BandFmt] ) + return( vips_image_write( byteswap->in, conversion->out ) ); + if( vips_image_pio_input( byteswap->in ) ) return( -1 );