From: Cristy Date: Sun, 5 Aug 2018 22:11:18 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-9~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a3663c3dc1165c8afe64d1adb014bb03c952d1b0;p=imagemagick ... --- diff --git a/coders/mat.c b/coders/mat.c index b1f4f1aac..9b71abc21 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -203,7 +203,7 @@ static void InsertComplexDoubleRow(Image *image,double *p,int y,double MinVal, if (f + GetPixelRed(image,q) > QuantumRange) SetPixelRed(image,QuantumRange,q); else - SetPixelRed(image,GetPixelRed(image,q)+(int) f,q); + SetPixelRed(image,GetPixelRed(image,q)+ClampToQuantum(f),q); f = GetPixelGreen(image,q)-f/2.0; if (f <= 0.0) { @@ -212,8 +212,8 @@ static void InsertComplexDoubleRow(Image *image,double *p,int y,double MinVal, } else { - SetPixelBlue(image,f,q); - SetPixelGreen(image,f,q); + SetPixelBlue(image,ClampToQuantum(f),q); + SetPixelGreen(image,ClampToQuantum(f),q); } } if (*p < 0)