gstvalue: Cast GST_MAKE_FOURCC arguments
authorEdward Hervey <edward@centricular.com>
Tue, 31 Oct 2017 10:39:23 +0000 (11:39 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 31 Oct 2017 11:02:18 +0000 (12:02 +0100)
To make it explicit that we are dealing with uint32 targets

Avoids erroneous  runtime error: left shift of negative value -1

https://bugzilla.gnome.org/show_bug.cgi?id=789700

gst/gstvalue.h

index 1c8b460..6beee7a 100644 (file)
@@ -42,7 +42,8 @@ G_BEGIN_DECLS
  * ]|
  *
  */
-#define GST_MAKE_FOURCC(a,b,c,d)        ((guint32)((a)|(b)<<8|(c)<<16|(d)<<24))
+#define GST_MAKE_FOURCC(a,b,c,d) \
+  ( (guint32)(a) | ((guint32) (b)) << 8  | ((guint32) (c)) << 16 | ((guint32) (d)) << 24 )
 
 /**
  * GST_STR_FOURCC: