From 94174beff065cb5683d09d79e992c3ebbdead311 Mon Sep 17 00:00:00 2001
From: Cristy <mikayla-grace@urban-warrior.org>
Date: Thu, 25 Feb 2021 19:34:39 -0500
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/3296

CVE: CVE-2021-20309
Upstream-Status: Backport [https://github.com/ImageMagick/ImageMagick/commit/94174beff065cb5683d09d79e992c3ebbdead311.patch]
Signed-off-by: Sana Kazi Sana.Kazi@kpit.com
---
 MagickCore/visual-effects.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MagickCore/visual-effects.c b/MagickCore/visual-effects.c
index 789660231b9..60a227951f9 100644
--- a/MagickCore/visual-effects.c
+++ b/MagickCore/visual-effects.c
@@ -3360,7 +3360,7 @@ MagickExport Image *WaveImage(const Image *image,const double amplitude,
     }
   for (i=0; i < (ssize_t) wave_image->columns; i++)
     sine_map[i]=(float) fabs(amplitude)+amplitude*sin((double)
-      ((2.0*MagickPI*i)/wave_length));
+      ((2.0*MagickPI*i)*PerceptibleReciprocal(wave_length)));
   /*
     Wave image.
   */
