]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
pixel-buffer: Fix overflow in blend_two_pixel_values
authorMartin Pitt <martin.pitt@ubuntu.com>
Fri, 14 Jan 2011 23:32:10 +0000 (18:32 -0500)
committerRay Strode <rstrode@redhat.com>
Fri, 14 Jan 2011 23:32:10 +0000 (18:32 -0500)
It was using 16bit types to hold the intermiediate
results of the blend, but for high intensity,
low opacity input values it could need up to
17 bits to prevent overflow.

https://bugs.freedesktop.org/show_bug.cgi?id=33129

src/libply-splash-core/ply-pixel-buffer.c

index 038601e65621fd13133ec0d6a08e3920b47a8e29..a612990a58a50604216ba4346e4ba02ab122c179 100644 (file)
@@ -65,7 +65,7 @@ blend_two_pixel_values (uint32_t pixel_value_1,
     {
       uint8_t alpha_1, red_1, green_1, blue_1;
       uint8_t red_2, green_2, blue_2;
-      uint_least16_t red, green, blue;
+      uint_least32_t red, green, blue;
 
       alpha_1 = (uint8_t) (pixel_value_1 >> 24);
       red_1 = (uint8_t) (pixel_value_1 >> 16);