From 2922c354ce21602ebea5cf9a894d3e28d464624b Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Thu, 20 Sep 2018 21:48:04 +0200 Subject: [PATCH] Improved format detection in the heic coder. --- coders/heic.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); } -- 2.40.0