mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-08 10:18:04 +02:00
glamor: Cannot use copies when accessing outside of composite source
Commitb64108fa("glamor: Check for composite operations which are equivalent to copies") failed to copy conditions from exaComposite which ensure that the composite operation doesn't access outside of the source picture. This fixes rendercheck regressions from the commit above. Reviewed-by: Keith Packard <keithp@keithp.com> (cherry picked from commit5ff75da317)
This commit is contained in:
parent
f5b224a0e2
commit
e02d217457
1 changed files with 15 additions and 12 deletions
|
|
@ -1422,18 +1422,21 @@ glamor_composite_clipped_region(CARD8 op,
|
|||
if (!mask && !source->alphaMap && !dest->alphaMap
|
||||
&& source->pDrawable && !source->transform
|
||||
&& ((op == PictOpSrc
|
||||
&& ((source->format == dest->format
|
||||
|| (PICT_FORMAT_COLOR(dest->format)
|
||||
&& PICT_FORMAT_COLOR(source->format)
|
||||
&& dest->format == PICT_FORMAT(PICT_FORMAT_BPP(source->format),
|
||||
PICT_FORMAT_TYPE(source->format),
|
||||
0,
|
||||
PICT_FORMAT_R(source->format),
|
||||
PICT_FORMAT_G(source->format),
|
||||
PICT_FORMAT_B(source->format))))
|
||||
|| (op == PictOpOver
|
||||
&& source->format == dest->format
|
||||
&& !PICT_FORMAT_A(source->format)))))) {
|
||||
&& (source->format == dest->format
|
||||
|| (PICT_FORMAT_COLOR(dest->format)
|
||||
&& PICT_FORMAT_COLOR(source->format)
|
||||
&& dest->format == PICT_FORMAT(PICT_FORMAT_BPP(source->format),
|
||||
PICT_FORMAT_TYPE(source->format),
|
||||
0,
|
||||
PICT_FORMAT_R(source->format),
|
||||
PICT_FORMAT_G(source->format),
|
||||
PICT_FORMAT_B(source->format)))))
|
||||
|| (op == PictOpOver
|
||||
&& source->format == dest->format
|
||||
&& !PICT_FORMAT_A(source->format)))
|
||||
&& x_source >= 0 && y_source >= 0
|
||||
&& (x_source + width) <= source->pDrawable->width
|
||||
&& (y_source + height) <= source->pDrawable->height) {
|
||||
x_source += source->pDrawable->x;
|
||||
y_source += source->pDrawable->y;
|
||||
x_dest += dest->pDrawable->x;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue