diff gui/ui/widgets.c @ 35361:3e8dcfa3ceef

Prevent unintended sign extension from int to long on 64-bit machines. If the property format is 32, the property data will be stored as an array of longs (which on 64-bit machines will be 64-bit values that are padded in the upper 4 bytes).
author ib
date Fri, 23 Nov 2012 12:08:56 +0000
parents bdf54c7f4eb6
children 411875efca3f
line wrap: on
line diff
--- a/gui/ui/widgets.c	Fri Nov 23 10:31:07 2012 +0000
+++ b/gui/ui/widgets.c	Fri Nov 23 12:08:56 2012 +0000
@@ -18,6 +18,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <stdint.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -100,7 +101,7 @@
             data = gdk_pixbuf_get_pixels(pixbuf);
 
             for (i = csize; i < guiIcon.collection_size; data += 4, i++)
-                guiIcon.collection[i] = (data[3] << 24) | AV_RB24(data);  // RGBA -> ARGB
+                guiIcon.collection[i] = (uint32_t)(data[3] << 24) | AV_RB24(data);  // RGBA -> ARGB
         }
 
         g_object_unref(pixbuf);