Bug 1236266 - Don't generate invalid empty regions in pixman (r=jmuizelaar)

This commit is contained in:
Bill McCloskey 2016-01-06 08:43:15 -08:00
parent d72068aa11
commit e5a4fce1c1

View File

@ -1334,6 +1334,15 @@ PREFIX(_intersect_rect) (region_type_t *dest,
region.extents.x2 = x + width;
region.extents.y2 = y + height;
if (!GOOD_RECT (&region.extents))
{
if (BAD_RECT (&region.extents))
_pixman_log_error (FUNC, "Invalid rectangle passed");
FREE_DATA (dest);
PREFIX (_init) (dest);
return TRUE;
}
return PREFIX(_intersect) (dest, source, &region);
}