From: Cristy Date: Fri, 30 Sep 2016 19:19:06 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/280 X-Git-Tag: 7.0.3-2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7bb158b7bedd1449a34432feb3a67c8f1873bfa;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/280 --- diff --git a/MagickCore/profile.c b/MagickCore/profile.c index ea7605770..4239d558c 100644 --- a/MagickCore/profile.c +++ b/MagickCore/profile.c @@ -2032,7 +2032,7 @@ MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile) break; /* corrupt EXIF */ tag_value=(ssize_t) ReadProfileShort(endian,q); format=(ssize_t) ReadProfileShort(endian,q+2); - if ((format-1) >= EXIF_NUM_FORMATS) + if ((format < 0) || ((format-1) >= EXIF_NUM_FORMATS)) break; components=(ssize_t) ReadProfileLong(endian,q+4); if (components < 0)