From: Dirk Lemstra Date: Thu, 20 Sep 2018 19:48:04 +0000 (+0200) Subject: Improved format detection in the heic coder. X-Git-Tag: 7.0.8-12~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2922c354ce21602ebea5cf9a894d3e28d464624b;p=imagemagick Improved format detection in the heic coder. --- diff --git a/coders/heic.c b/coders/heic.c index 5ede21515..379ae7ee8 100644 --- a/coders/heic.c +++ b/coders/heic.c @@ -408,8 +408,14 @@ static MagickBooleanType IsHEIC(const unsigned char *magick,const size_t length) { if (length < 12) return(MagickFalse); + if (LocaleNCompare((const char *) magick+4,"ftyp",4) != 0) + return(MagickFalse); if (LocaleNCompare((const char *) magick+8,"heic",4) == 0) return(MagickTrue); + if (LocaleNCompare((const char *) magick+8,"heix",4) == 0) + return(MagickTrue); + if (LocaleNCompare((const char *) magick+8,"mif1",4) == 0) + return(MagickTrue); return(MagickFalse); }