File ImageMagick-CVE-2020-27560.patch of Package ImageMagick.23974
diff --git a/magick/layer.c b/magick/layer.c
index ca7ab5da6..e5c83ede6 100644
--- a/magick/layer.c
+++ b/magick/layer.c
@@ -1382,11 +1382,13 @@ static Image *OptimizeLayerFrames(const Image *image,
if ( disposals[i] == DelDispose ) {
size_t time = 0;
while ( disposals[i] == DelDispose ) {
- time += curr->delay*1000/curr->ticks_per_second;
+ time += (size_t) (curr->delay*1000*
+ PerceptibleReciprocal((double) curr->ticks_per_second));
curr=GetNextImageInList(curr);
i++;
}
- time += curr->delay*1000/curr->ticks_per_second;
+ time += (size_t) (curr->delay*1000*
+ PerceptibleReciprocal((double) curr->ticks_per_second));
prev_image->ticks_per_second = 100L;
prev_image->delay = time*prev_image->ticks_per_second/1000;
}