fail vips7 openslide if level argument is not numeric
in case users forget the leading comma when specifying an associated image, etc.
This commit is contained in:
parent
334452d681
commit
5e1b4f2c00
|
@ -58,14 +58,21 @@ im_openslide2vips( const char *name, IMAGE *out )
|
||||||
char *p, *q;
|
char *p, *q;
|
||||||
char *associated;
|
char *associated;
|
||||||
int level;
|
int level;
|
||||||
|
char *endptr;
|
||||||
VipsImage *t;
|
VipsImage *t;
|
||||||
|
|
||||||
im_filename_split( name, filename, mode );
|
im_filename_split( name, filename, mode );
|
||||||
level = 0;
|
level = 0;
|
||||||
associated = NULL;
|
associated = NULL;
|
||||||
p = &mode[0];
|
p = &mode[0];
|
||||||
if( (q = im_getnextoption( &p )) )
|
if( (q = im_getnextoption( &p )) ) {
|
||||||
level = atoi( q );
|
level = strtoul( q, &endptr, 10 );
|
||||||
|
if( *endptr ) {
|
||||||
|
vips_error( "openslide2vips", "%s",
|
||||||
|
_( "level must be a number" ) );
|
||||||
|
return( -1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
if( (q = im_getnextoption( &p )) )
|
if( (q = im_getnextoption( &p )) )
|
||||||
associated = q;
|
associated = q;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue