tests: rtpbin_buffer_list: fix possible unaligned read on 32-bit ARM

Fixes #2666

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4856>
This commit is contained in:
Tim-Philipp Müller 2023-06-12 19:24:15 +01:00
parent 72684d49c9
commit ad8bcb0aaf

View file

@ -25,6 +25,12 @@
#include <gst/rtp/gstrtpbuffer.h>
#include <gst/rtp/gstrtcpbuffer.h>
#if G_BYTE_ORDER == G_BIG_ENDIAN
#define READ_UINT64(mem) GST_READ_UINT64_BE(mem)
#else
#define READ_UINT64(mem) GST_READ_UINT64_LE(mem)
#endif
/* UDP/IP is assumed for bandwidth calculation */
#define UDP_IP_HEADER_OVERHEAD 28
@ -236,8 +242,8 @@ check_header (GstBuffer * buffer, guint index)
* most likely be changed in gstrtpbin.
*/
fail_unless (info.data != NULL);
fail_unless_equals_uint64 (*(guint64 *) info.data,
*(guint64 *) rtp_header[index]);
fail_unless_equals_uint64 (READ_UINT64 (info.data),
READ_UINT64 (rtp_header[index]));
fail_unless (*(guint16 *) (info.data + 12) ==
*(guint16 *) (rtp_header[index] + 12));