mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
mxftypes: Don't store pointers in stack allocated guints
This works usually in this place, unless the compiler optimizes things in interesting ways in which case it causes stack corruption and crashes later. The compiler in question here is clang with -O1, which seems to pack the stack a bit more and causes writing to the guint as pointer to overwrite map.memory, which then later crashes during unmapping of the memory.
This commit is contained in:
parent
5a1953b31f
commit
b6696122a0
1 changed files with 3 additions and 4 deletions
|
@ -1585,15 +1585,14 @@ mxf_primer_pack_to_buffer (const MXFPrimerPack * pack)
|
|||
data += 8;
|
||||
|
||||
if (pack->mappings) {
|
||||
guint local_tag;
|
||||
gpointer local_tag;
|
||||
MXFUL *ul;
|
||||
GHashTableIter iter;
|
||||
|
||||
g_hash_table_iter_init (&iter, pack->mappings);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, (gpointer) & local_tag,
|
||||
(gpointer) & ul)) {
|
||||
GST_WRITE_UINT16_BE (data, local_tag);
|
||||
while (g_hash_table_iter_next (&iter, &local_tag, (gpointer) & ul)) {
|
||||
GST_WRITE_UINT16_BE (data, GPOINTER_TO_UINT (local_tag));
|
||||
memcpy (data + 2, ul, 16);
|
||||
data += 18;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue