Merge pull request #1785 from lovell/magick-is-a-buffer-min-len

Ensure magick buffer+file checks use consistent min length guard
This commit is contained in:
John Cupitt 2020-08-17 12:51:37 +01:00 committed by GitHub
commit 98fdc17d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -256,7 +256,7 @@ G_DEFINE_TYPE( VipsForeignLoadMagickBuffer, vips_foreign_load_magick_buffer,
static gboolean
vips_foreign_load_magick_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 ) );
}
/* Unfortunately, libMagick does not support header-only reads very well. See