From 48a729fa9ce0d013ddc72ab8ba5ee3ebf3ca3caa Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 17 Sep 2019 00:00:45 +0200 Subject: Fix overflow in autotrace channel reduction --- src/trace/autotrace/inkscape-autotrace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/trace/autotrace/inkscape-autotrace.cpp b/src/trace/autotrace/inkscape-autotrace.cpp index 9ce4132bb..58abe8c61 100644 --- a/src/trace/autotrace/inkscape-autotrace.cpp +++ b/src/trace/autotrace/inkscape-autotrace.cpp @@ -65,7 +65,7 @@ static guchar* to_3channels(GdkPixbuf* input) { for(int chan=0;chan<3;chan++) { guchar *pnew = (pix + row * rs + col * 3 + chan); guchar *pold = (pix + row * rs + col * 4 + chan); - out[x++] = ((*pold) * alpha / 256 + white); + out[x++] = (char)(((int)(*pold) * (int)alpha / 256) + white); } } } -- cgit v1.2.3