mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-02 09:38:22 +02:00
[cairo-pattern] Fix crash in solid-pattern-surface cache
Ickle knew something when he only extended cache size when we are committed to inserting something into the cache. I broke that while fixing other issues a while ago. This cache just doesn't want to give us any rest...
This commit is contained in:
parent
7c9536b653
commit
1c729f85ed
1 changed files with 3 additions and 4 deletions
|
|
@ -1478,10 +1478,6 @@ _cairo_pattern_acquire_surface_for_solid (cairo_solid_pattern_t *pattern,
|
|||
surface = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i = solid_surface_cache.size++;
|
||||
}
|
||||
|
||||
if (surface == NULL) {
|
||||
/* Not cached, need to create new */
|
||||
|
|
@ -1499,6 +1495,9 @@ _cairo_pattern_acquire_surface_for_solid (cairo_solid_pattern_t *pattern,
|
|||
}
|
||||
}
|
||||
|
||||
if (i == solid_surface_cache.size)
|
||||
solid_surface_cache.size++;
|
||||
|
||||
to_destroy = solid_surface_cache.cache[i].surface;
|
||||
solid_surface_cache.cache[i].surface = surface;
|
||||
solid_surface_cache.cache[i].color = pattern->color;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue