From 8e9b75ea13bf007724d5e6dd5625f9af7d6098fa Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 12 May 2021 08:16:30 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/3653 --- magick/cache.c | 4 +++- magick/utility-private.h | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/magick/cache.c b/magick/cache.c index c3f0fb9df0..f26fe3c3ac 100644 --- a/magick/cache.c +++ b/magick/cache.c @@ -2946,7 +2946,9 @@ static inline MagickModulo VirtualPixelModulo(const ssize_t offset, MagickModulo modulo; - modulo.quotient=offset/((ssize_t) extent); + modulo.quotient=offset; + if (extent != 0) + modulo.quotient=offset/((ssize_t) extent); modulo.remainder=offset % ((ssize_t) extent); if ((modulo.remainder != 0) && ((offset ^ ((ssize_t) extent)) < 0)) { diff --git a/magick/utility-private.h b/magick/utility-private.h index c94a3c43a7..1c54b73d89 100644 --- a/magick/utility-private.h +++ b/magick/utility-private.h @@ -32,14 +32,10 @@ extern MagickPrivate MagickBooleanType static inline int MagickReadDirectory(DIR *directory,struct dirent *entry, struct dirent **result) { -#if defined(MAGICKCORE_HAVE_READDIR_R) - return(readdir_r(directory,entry,result)); -#else (void) entry; errno=0; *result=readdir(directory); return(errno); -#endif } /*