From a0a6868d90d0f850b337309ad2e1ed19ed0fbb33 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 17 Jul 2014 03:31:58 +0100 Subject: [PATCH] better error detection in vips_system() --- ChangeLog | 1 + libvips/iofuncs/system.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f463934..1172b87e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ - vips_scale() now does round to nearest to avoid rounding errors - improve im_openout() compat macro - more vips7 compatibility fixes, thanks steve +- more robust vips_system() 30/6/14 started 7.40.3 - fix interlaced thumbnails in vipsthumbnail, thanks lovell diff --git a/libvips/iofuncs/system.c b/libvips/iofuncs/system.c index 55df343e..028cc25b 100644 --- a/libvips/iofuncs/system.c +++ b/libvips/iofuncs/system.c @@ -177,7 +177,8 @@ vips_system_build( VipsObject *object ) memmove( p, p + 1, strlen( p ) ); if( !g_spawn_command_line_sync( cmd, - &std_output, &std_error, &result, &error ) ) { + &std_output, &std_error, &result, &error ) || + result ) { if( error ) { vips_error( class->nickname, "%s", error->message ); g_error_free( error ); @@ -202,8 +203,6 @@ vips_system_build( VipsObject *object ) return( -1 ); } - g_assert( !result ); - if( std_error ) { vips__chomp( std_error ); if( strcmp( std_error, "" ) != 0 )