mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
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.
This commit is contained in:
parent
dfa627da30
commit
6756475fd3
1 changed files with 5 additions and 5 deletions
|
@ -1707,7 +1707,7 @@ gst_avi_demux_parse_odml (GstAviDemux * avi, GstBuffer * buf)
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
_dmlh = (gst_riff_dmlh *) GST_BUFFER_DATA (sub);
|
_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, "dmlh tag found:");
|
||||||
GST_INFO_OBJECT (avi, " totalframes: %u", dmlh.totalframes);
|
GST_INFO_OBJECT (avi, " totalframes: %u", dmlh.totalframes);
|
||||||
|
@ -1799,10 +1799,10 @@ gst_avi_demux_parse_index (GstAviDemux * avi,
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
|
|
||||||
_entry = &((gst_riff_index_entry *) data)[i];
|
_entry = &((gst_riff_index_entry *) data)[i];
|
||||||
entry.id = GUINT32_FROM_LE (_entry->id);
|
entry.id = GST_READ_UINT32_LE (&_entry->id);
|
||||||
entry.offset = GUINT32_FROM_LE (_entry->offset);
|
entry.offset = GST_READ_UINT32_LE (&_entry->offset);
|
||||||
entry.flags = GUINT32_FROM_LE (_entry->flags);
|
entry.flags = GST_READ_UINT32_LE (&_entry->flags);
|
||||||
entry.size = GUINT32_FROM_LE (_entry->size);
|
entry.size = GST_READ_UINT32_LE (&_entry->size);
|
||||||
target = &entries[n];
|
target = &entries[n];
|
||||||
|
|
||||||
if (entry.id == GST_RIFF_rec || entry.id == 0 ||
|
if (entry.id == GST_RIFF_rec || entry.id == 0 ||
|
||||||
|
|
Loading…
Reference in a new issue