libs/gst/dataprotocol/dataprotocol.c: Don't write to the same region of memory as a uint64 and uint16 as this breaks ...

Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c:
Don't write to the same region of memory as a uint64 and uint16
as this breaks strict aliasing rules and apparantly breaks on PPC
and s390. Thanks to Sjoerd Simons for analysing. Fixes bug #348114.
This commit is contained in:
Sebastian Dröge 2008-06-30 09:38:45 +00:00
parent b1b4a78ffc
commit 05d13e84ea
2 changed files with 8 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2008-06-30 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* libs/gst/dataprotocol/dataprotocol.c:
Don't write to the same region of memory as a uint64 and uint16
as this breaks strict aliasing rules and apparantly breaks on PPC
and s390. Thanks to Sjoerd Simons for analysing. Fixes bug #348114.
2008-06-29 Stefan Kost <ensonic@users.sf.net> 2008-06-29 Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/gstinterpolationcontrolsource.c: * libs/gst/controller/gstinterpolationcontrolsource.c:

View file

@ -82,7 +82,7 @@ GST_DEBUG_CATEGORY_STATIC (data_protocol_debug);
/* helper macros */ /* helper macros */
/* write first 6 bytes of header, as well as ABI padding */ /* write first 6 bytes of header */
#define GST_DP_INIT_HEADER(h, version, flags, type) \ #define GST_DP_INIT_HEADER(h, version, flags, type) \
G_STMT_START { \ G_STMT_START { \
gint maj = 0, min = 0; \ gint maj = 0, min = 0; \
@ -95,9 +95,6 @@ G_STMT_START { \
h[2] = (guint8) flags; \ h[2] = (guint8) flags; \
h[3] = 0; /* padding byte */ \ h[3] = 0; /* padding byte */ \
GST_WRITE_UINT16_BE (h + 4, type); \ GST_WRITE_UINT16_BE (h + 4, type); \
\
GST_WRITE_UINT64_BE (h + 42, (guint64) 0); /* ABI padding */ \
GST_WRITE_UINT64_BE (h + 50, (guint64) 0); /* ABI padding */ \
} G_STMT_END } G_STMT_END
#define GST_DP_SET_CRC(h, flags, payload, length); \ #define GST_DP_SET_CRC(h, flags, payload, length); \