Skip to content
Permalink
Browse files Browse the repository at this point in the history
https://github.com/ImageMagick/ImageMagick/issues/354
  • Loading branch information
Cristy committed Jan 12, 2017
1 parent ac36bf9 commit 9a069e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MagickCore/profile.c
Expand Up @@ -2043,7 +2043,7 @@ MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile)
The directory entry contains an offset.
*/
offset=(ssize_t) ReadProfileLong(endian,q+8);
if ((size_t) (offset+number_bytes) > length)
if ((offset < 0) || ((size_t) (offset+number_bytes) > length))
continue;
if (~length < number_bytes)
continue; /* prevent overflow */
Expand Down

0 comments on commit 9a069e0

Please sign in to comment.