From e27d6448b1d68c88d5d69948a0cd1bc3e064c995 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 22 Oct 2019 23:07:17 +0100 Subject: [PATCH] fix debug build --- libvips/conversion/switch.c | 4 ++-- libvips/iofuncs/streami.c | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libvips/conversion/switch.c b/libvips/conversion/switch.c index 055b372b..0669039a 100644 --- a/libvips/conversion/switch.c +++ b/libvips/conversion/switch.c @@ -74,8 +74,8 @@ vips_switch_gen( VipsRegion *or, void *seq, void *a, void *b, if( vips_reorder_prepare_many( or->im, ar, r ) ) return( -1 ); - g_assert( ar->im->BandFmt == VIPS_FORMAT_UCHAR ); - g_assert( ar->im->Bands == 1 ); + g_assert( ar[0]->im->BandFmt == VIPS_FORMAT_UCHAR ); + g_assert( ar[0]->im->Bands == 1 ); for( i = 0; i < swit->n; i++ ) { p[i] = VIPS_REGION_ADDR( ar[i], r->left, r->top ); diff --git a/libvips/iofuncs/streami.c b/libvips/iofuncs/streami.c index 235b4aaa..e513160c 100644 --- a/libvips/iofuncs/streami.c +++ b/libvips/iofuncs/streami.c @@ -102,7 +102,8 @@ vips_streami_sanity( VipsStreami *streami ) */ g_assert( streami->read_position >= 0 ); g_assert( streami->read_position < streami->length ); - g_assert( streami->read_position < area->length ); + g_assert( streami->read_position < + VIPS_AREA( streami->blob )->length ); /* No need for header tracking. */ @@ -115,10 +116,10 @@ vips_streami_sanity( VipsStreami *streami ) /* No descriptor or filename. */ - g_assert( stream->descriptor == -1 ); - g_assert( stream->close_descriptor == -1 ); - g_assert( stream->tracked_descriptor == -1 ); - g_assert( !stream->filename ); + g_assert( VIPS_STREAM( streami )->descriptor == -1 ); + g_assert( VIPS_STREAM( streami )->close_descriptor == -1 ); + g_assert( VIPS_STREAM( streami )->tracked_descriptor == -1 ); + g_assert( !VIPS_STREAM( streami )->filename ); } else if( streami->is_pipe ) { /* In header, read_position must be within header_bytes. @@ -178,8 +179,9 @@ vips_streami_sanity( VipsStreami *streami ) /* Supports minimise, so if descriptor is -1, we must have a * filename we can reopen. */ - g_assert( stream->descriptor != -1 || - (stream->filename && stream->descriptor) ); + g_assert( VIPS_STREAM( streami )->descriptor != -1 || + (VIPS_STREAM( streami )->filename && + VIPS_STREAM( streami )->descriptor) ); } }