summaryrefslogtreecommitdiff
path: root/user/gst-plugins-good/fix-arm-test-alignment.patch
blob: 2b2a6a0c06cac755c52542a98d56c600e252b0c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 57ced2fded938aa08d8727683a1823ae36170fc3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
Date: Mon, 12 Jun 2023 19:24:15 +0100
Subject: [PATCH] tests: rtpbin_buffer_list: fix possible unaligned read on
 32-bit ARM

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/689
---
 .../tests/check/elements/rtpbin_buffer_list.c          | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/subprojects/gst-plugins-good/tests/check/elements/rtpbin_buffer_list.c b/subprojects/gst-plugins-good/tests/check/elements/rtpbin_buffer_list.c
index b804744352a..1c3d5cdd3a7 100644
--- a/tests/check/elements/rtpbin_buffer_list.c
+++ b/tests/check/elements/rtpbin_buffer_list.c
@@ -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));
 
-- 
GitLab