mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-24 21:50:19 +01:00
[pixman] Free the old rects if we fail to allocate new.
During the pixman_op, a complicated dance is performed to handle enlarging the rectangle array to accommodate the op. One consequence of this is to, under certain circumstances, replace the current rectangle array with emptyData and track the old array with oldData. Hence if we fail to realloc the enlarged array we need to free oldData.
This commit is contained in:
parent
ef30708217
commit
5ec27eef95
1 changed files with 6 additions and 2 deletions
|
|
@ -670,9 +670,13 @@ pixman_op(
|
|||
newReg->data = &pixman_region_emptyData;
|
||||
else if (newReg->data->size)
|
||||
newReg->data->numRects = 0;
|
||||
if (newSize > newReg->data->size)
|
||||
if (!pixman_rect_alloc(newReg, newSize))
|
||||
if (newSize > newReg->data->size) {
|
||||
if (!pixman_rect_alloc(newReg, newSize)) {
|
||||
if (oldData)
|
||||
free (oldData);
|
||||
return PIXMAN_REGION_STATUS_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize ybot.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue