Ensure magick7 buffer+file checks use consistent min length guard
Prevents a zero-length buffer from crashing GetImageMagick
This commit is contained in:
parent
77365a8a6f
commit
20bdc41225
@ -841,7 +841,7 @@ G_DEFINE_TYPE( VipsForeignLoadMagick7Buffer, vips_foreign_load_magick7_buffer,
|
|||||||
static gboolean
|
static gboolean
|
||||||
vips_foreign_load_magick7_buffer_is_a_buffer( const void *buf, size_t len )
|
vips_foreign_load_magick7_buffer_is_a_buffer( const void *buf, size_t len )
|
||||||
{
|
{
|
||||||
return( magick_ismagick( (const unsigned char *) buf, len ) );
|
return( len > 10 && magick_ismagick( (const unsigned char *) buf, len ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user