Fix a 64-bit segfault in kdenlive
authorRay Lehtiniemi <rayl@mail.com>
Wed, 8 Apr 2009 04:14:20 +0000 (22:14 -0600)
committerRay Lehtiniemi <rayl@mail.com>
Wed, 8 Apr 2009 04:19:51 +0000 (22:19 -0600)
To reproduce:
 - create a new project
 - create a color clip
 - add clip to timeline
 - set an in point on the clip
 - add the box blur effect

The segfault happens because we take the negative of an unsigned
integer. This works out to a signed 32 bit value on a 64 bit
platform, which causes the rgb array bounds to be exceeded.

Signed-off-by: Ray Lehtiniemi <rayl@mail.com>

src/modules/kdenlive/filter_boxblur.c

index f2316d0..f1d5425 100644 (file)
@@ -26,7 +26,7 @@
 #include <math.h>
 
 
-static void PreCompute(uint8_t *yuv, int32_t *rgb, unsigned int width, unsigned int height)
+static void PreCompute(uint8_t *yuv, int32_t *rgb, int width, int height)
 {
        register int x, y, z;
        register int uneven = width % 2;