summaryrefslogtreecommitdiff
path: root/user/gst-plugins-bad/fix-arm-parser-alignment.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/gst-plugins-bad/fix-arm-parser-alignment.patch')
-rw-r--r--user/gst-plugins-bad/fix-arm-parser-alignment.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/user/gst-plugins-bad/fix-arm-parser-alignment.patch b/user/gst-plugins-bad/fix-arm-parser-alignment.patch
new file mode 100644
index 000000000..63715380e
--- /dev/null
+++ b/user/gst-plugins-bad/fix-arm-parser-alignment.patch
@@ -0,0 +1,32 @@
+This patch differs from upstream in the following way(s):
+
+ * Paths changed to accommodate 'builddir'
+
+From 10930661ee8ab2f43078ece482c33ca74c2440fb Mon Sep 17 00:00:00 2001
+From: Zach van Rijn <me@zv.io>
+Date: Thu, 13 Jun 2024 09:11:30 -0500
+Subject: [PATCH] pcapparse: Avoid unaligned memory access
+
+Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3602
+---
+ subprojects/gst-plugins-bad/gst/pcapparse/gstpcapparse.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/subprojects/gst-plugins-bad/gst/pcapparse/gstpcapparse.c b/subprojects/gst-plugins-bad/gst/pcapparse/gstpcapparse.c
+index 53e7ef6fc25..0a9c9a6063b 100644
+--- a/gst/pcapparse/gstpcapparse.c
++++ b/gst/pcapparse/gstpcapparse.c
+@@ -456,8 +456,8 @@ gst_pcap_parse_scan_frame (GstPcapParse * self,
+ return FALSE;
+
+ /* ip info */
+- ip_src_addr = *((guint32 *) (buf_ip + 12));
+- ip_dst_addr = *((guint32 *) (buf_ip + 16));
++ memcpy(&ip_src_addr, buf_ip + 12, sizeof(ip_src_addr));
++ memcpy(&ip_dst_addr, buf_ip + 16, sizeof(ip_dst_addr));
+ buf_proto = buf_ip + ip_header_size;
+ ip_packet_len = GUINT16_FROM_BE (*(guint16 *) (buf_ip + 2));
+
+--
+GitLab
+