diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2020-10-08 19:54:55 +0300 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-10-09 01:22:18 +0300 |
commit | ed2b5e6cfc363b483df9975d972ebf2a3f57ccc2 (patch) | |
tree | 837a62f91814dbd3f927fd77084adc03a9e98225 /gst | |
parent | 591af0f38aa5504e2a9d7a200b6ef52c2733d152 (diff) |
rtpulpfec: fix potential alignment issue in xor function
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/753#note_646453
for context
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/753>
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rtp/rtpulpfeccommon.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gst/rtp/rtpulpfeccommon.c b/gst/rtp/rtpulpfeccommon.c index 7c6bf5876..25b2f00f1 100644 --- a/gst/rtp/rtpulpfeccommon.c +++ b/gst/rtp/rtpulpfeccommon.c @@ -123,7 +123,13 @@ _xor_mem (guint8 * restrict dst, const guint8 * restrict src, gsize length) guint i; for (i = 0; i < (length / sizeof (guint64)); ++i) { - *((guint64 *) dst) ^= *((const guint64 *) src); +#if G_BYTE_ORDER == G_LITTLE_ENDIAN + GST_WRITE_UINT64_LE (dst, + GST_READ_UINT64_LE (dst) ^ GST_READ_UINT64_LE (src)); +#else + GST_WRITE_UINT64_BE (dst, + GST_READ_UINT64_BE (dst) ^ GST_READ_UINT64_BE (src)); +#endif dst += sizeof (guint64); src += sizeof (guint64); } |