After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789700 - gstvalue: Cast GST_MAKE_FOURCC arguments
gstvalue: Cast GST_MAKE_FOURCC arguments
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-31 10:40 UTC by Edward Hervey
Modified: 2017-10-31 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstvalue: Cast GST_MAKE_FOURCC arguments (881 bytes, patch)
2017-10-31 10:40 UTC, Edward Hervey
none Details | Review
gstvalue: Cast GST_MAKE_FOURCC arguments (882 bytes, patch)
2017-10-31 11:02 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2017-10-31 10:40:48 UTC
See commit
Comment 1 Edward Hervey 2017-10-31 10:40:53 UTC
Created attachment 362613 [details] [review]
gstvalue: Cast GST_MAKE_FOURCC arguments

To make it explicit that we are dealing with uint32 targets

Avoids erroneous  runtime error: left shift of negative value -1
Comment 2 Tim-Philipp Müller 2017-10-31 10:55:49 UTC
Comment on attachment 362613 [details] [review]
gstvalue: Cast GST_MAKE_FOURCC arguments

>+#define GST_MAKE_FOURCC(a,b,c,d) \
>+  ( (guint32)(a) | (guint32) ((b) << 8)  | (guint32) ((c) << 16) | (guint32) ((d) << 24))

Is this really what you want, rather than e.g.

  (((guint32)(b)) << 8)

etc. ? (i.e. cast go guint32 before shifting)
Comment 3 Edward Hervey 2017-10-31 11:02:39 UTC
Created attachment 362614 [details] [review]
gstvalue: Cast GST_MAKE_FOURCC arguments

To make it explicit that we are dealing with uint32 targets

Avoids erroneous  runtime error: left shift of negative value -1
Comment 4 Edward Hervey 2017-10-31 14:31:22 UTC
commit fb56ad6bee2366813f6be4f697579c06774b062d (HEAD -> master, origin/master, origin/HEAD)
Author: Edward Hervey <edward@centricular.com>
Date:   Tue Oct 31 11:39:23 2017 +0100

    gstvalue: Cast GST_MAKE_FOURCC arguments
    
    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