bits_image_fetch_pixel_convolution(): Make sure channels are signed
authorSøren Sandmann Pedersen <ssp@redhat.com>
Thu, 5 Apr 2012 04:52:21 +0000 (00:52 -0400)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Fri, 20 Apr 2012 14:17:13 +0000 (10:17 -0400)
commite24c1c849d29f43dc6e50e1f15102709059b40f8
treedc79f51ee0fe3d76868cb82a8bfa9f4478fb1feb
parent4d2fee14063b960c6b81b55dd3aa94b956d23eeb
bits_image_fetch_pixel_convolution(): Make sure channels are signed

In the computation:

    srtot += RED_8 (pixel) * f

RED_8 (pixel) is an unsigned quantity, which means the signed filter
coefficient f gets converted to an unsigned integer before the
multiplication. We get away with this because when the 32 bit unsigned
result is converted to int32_t, the correct sign is produced. But if
srtot had been an int64_t, the result would have been a very large
positive number.

Fix this by explicitly casting the channels to int.
pixman/pixman-bits-image.c