mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-21 08:28:53 +02:00
resources: compiler: Fix resources on big endian architectures
Resources are always little endian, so the gvdb is byteswapped. When looking up the value, it would return a new byteswapped variant, making the data returned from do_lookup() invalid once that variant is unref'd. Since byteswapping doesn't matter for the "ay" data anyway, just use gvdb_table_get_raw_value() instead and only byteswap the length and flag values. https://bugzilla.gnome.org/show_bug.cgi?id=673409
This commit is contained in:
@@ -287,7 +287,7 @@ gboolean do_lookup (GResource *resource,
|
|||||||
free_path[path_len-1] = 0;
|
free_path[path_len-1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = gvdb_table_get_value (resource->table, path);
|
value = gvdb_table_get_raw_value (resource->table, path);
|
||||||
|
|
||||||
if (value == NULL)
|
if (value == NULL)
|
||||||
{
|
{
|
||||||
@@ -305,6 +305,9 @@ gboolean do_lookup (GResource *resource,
|
|||||||
&_flags,
|
&_flags,
|
||||||
&array);
|
&array);
|
||||||
|
|
||||||
|
_size = GUINT32_FROM_LE (_size);
|
||||||
|
_flags = GUINT32_FROM_LE (_flags);
|
||||||
|
|
||||||
if (size)
|
if (size)
|
||||||
*size = _size;
|
*size = _size;
|
||||||
if (flags)
|
if (flags)
|
||||||
|
Reference in New Issue
Block a user