Ensure magick7 buffer+file checks use consistent min length guard

Prevents a zero-length buffer from crashing GetImageMagick
This commit is contained in:
Lovell Fuller 2020-05-05 12:11:37 +01:00
parent 77365a8a6f
commit 20bdc41225
1 changed files with 1 additions and 1 deletions

View File

@ -841,7 +841,7 @@ G_DEFINE_TYPE( VipsForeignLoadMagick7Buffer, vips_foreign_load_magick7_buffer,
static gboolean
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