From 6756475fd3af29844a77bcb08d9943070daf6f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 22 Feb 2009 18:32:02 +0100 Subject: [PATCH] avidemux: Fix alignment issues by using GST_READ_* Reading integers from random memory addresses will result in SIGBUS on some architectures if the memory address is not correctly aligned. This can happen at two places in avidemux so we should use GST_READ_UINT32_LE and friends here. Fixes bug #572256. --- gst/avi/gstavidemux.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 7a3166cfd7..2473b922ce 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -1707,7 +1707,7 @@ gst_avi_demux_parse_odml (GstAviDemux * avi, GstBuffer * buf) goto next; } _dmlh = (gst_riff_dmlh *) GST_BUFFER_DATA (sub); - dmlh.totalframes = GUINT32_FROM_LE (_dmlh->totalframes); + dmlh.totalframes = GST_READ_UINT32_LE (&_dmlh->totalframes); GST_INFO_OBJECT (avi, "dmlh tag found:"); GST_INFO_OBJECT (avi, " totalframes: %u", dmlh.totalframes); @@ -1799,10 +1799,10 @@ gst_avi_demux_parse_index (GstAviDemux * avi, GstFormat format; _entry = &((gst_riff_index_entry *) data)[i]; - entry.id = GUINT32_FROM_LE (_entry->id); - entry.offset = GUINT32_FROM_LE (_entry->offset); - entry.flags = GUINT32_FROM_LE (_entry->flags); - entry.size = GUINT32_FROM_LE (_entry->size); + entry.id = GST_READ_UINT32_LE (&_entry->id); + entry.offset = GST_READ_UINT32_LE (&_entry->offset); + entry.flags = GST_READ_UINT32_LE (&_entry->flags); + entry.size = GST_READ_UINT32_LE (&_entry->size); target = &entries[n]; if (entry.id == GST_RIFF_rec || entry.id == 0 ||