diff --git a/magick/memory.c b/magick/memory.c index c5becbdd0e..8721a2326c 100644 --- a/magick/memory.c +++ b/magick/memory.c @@ -1628,7 +1628,7 @@ MagickPrivate MagickBooleanType ShredMagickMemory(void *memory, /* Overwrite the memory buffer with random data. */ - quantum=(size_t) MagickMin(length,MagickMaxBufferExtent); + quantum=(size_t) MagickMin(length,MagickMinBufferExtent); random_info=AcquireRandomInfo(); key=GetRandomKey(random_info,quantum); for (i=0; i < passes; i++) diff --git a/magick/utility.c b/magick/utility.c index 16ccbf6398..3b31119001 100644 --- a/magick/utility.c +++ b/magick/utility.c @@ -1901,9 +1901,9 @@ MagickPrivate MagickBooleanType ShredFile(const char *path) /* Shred the file. */ - quantum=(size_t) MagickMaxBufferExtent; + quantum=(size_t) MagickMinBufferExtent; if ((fstat(file,&file_stats) == 0) && (file_stats.st_size > 0)) - quantum=(size_t) MagickMin(file_stats.st_size,MagickMaxBufferExtent); + quantum=(size_t) MagickMin(file_stats.st_size,MagickMinBufferExtent); length=(MagickSizeType) file_stats.st_size; random_info=AcquireRandomInfo(); key=GetRandomKey(random_info,quantum);