vipsheader could crash on bad field names

we were not checking the return of vips_image_get_as_string()
This commit is contained in:
John Cupitt 2017-02-24 14:30:26 +00:00
parent 6cbda61ec1
commit dbbe8b77c1
1 changed files with 2 additions and 1 deletions

View File

@ -149,7 +149,8 @@ print_header( VipsImage *im, gboolean many )
else {
char *str;
vips_image_get_as_string( im, main_option_field, &str );
if( vips_image_get_as_string( im, main_option_field, &str ) )
return( -1 );
printf( "%s\n", str );
g_free( str );
}