forked from AuroraMiddleware/gtk
iconcache: Always check return value of find_image_offset.
find_image_offset returns 0 if it failed to find a matching image. Check this return value in _gtk_icon_cache_get_icon to avoid making bad memory accesses later. Signed-off-by: Will Newton <will.newton@imgtec.com> https://bugzilla.gnome.org/show_bug.cgi?id=667745
This commit is contained in:
parent
dbd66a8f02
commit
96cfd3f8c7
@ -448,6 +448,9 @@ _gtk_icon_cache_get_icon (GtkIconCache *cache,
|
||||
|
||||
offset = find_image_offset (cache, icon_name, directory_index);
|
||||
|
||||
if (!offset)
|
||||
return NULL;
|
||||
|
||||
image_data_offset = GET_UINT32 (cache->buffer, offset + 4);
|
||||
|
||||
if (!image_data_offset)
|
||||
|
Loading…
Reference in New Issue
Block a user