mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-08 03:18:06 +02:00
Bug #7366: Fix two crashes in operations on source pictures.
A screen's ChangePictureTransform now isn't called when changing the transform,
as source pictures aren't associated with screens. Also, attempting to set
an AlphaMap to a source picture will fail with BadMatch just like a Window
would, preventing another crash.
(cherry picked from 6ef4579139 commit)
This commit is contained in:
parent
fa5ea59d2d
commit
c5bdc9aea0
2 changed files with 16 additions and 6 deletions
|
|
@ -1217,7 +1217,8 @@ ChangePicture (PicturePtr pPicture,
|
|||
error = BadPixmap;
|
||||
break;
|
||||
}
|
||||
if (pAlpha->pDrawable->type != DRAWABLE_PIXMAP)
|
||||
if (pAlpha->pDrawable == NULL ||
|
||||
pAlpha->pDrawable->type != DRAWABLE_PIXMAP)
|
||||
{
|
||||
client->errorValue = pid;
|
||||
error = BadMatch;
|
||||
|
|
@ -1469,9 +1470,6 @@ SetPictureTransform (PicturePtr pPicture,
|
|||
{ 0x00000, xFixed1, 0x00000 },
|
||||
{ 0x00000, 0x00000, xFixed1 },
|
||||
} };
|
||||
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
int result;
|
||||
|
||||
if (transform && memcmp (transform, &identity, sizeof (PictTransform)) == 0)
|
||||
transform = 0;
|
||||
|
|
@ -1496,9 +1494,16 @@ SetPictureTransform (PicturePtr pPicture,
|
|||
}
|
||||
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
|
||||
|
||||
result = (*ps->ChangePictureTransform) (pPicture, transform);
|
||||
if (pPicture->pDrawable != NULL) {
|
||||
int result;
|
||||
PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen);
|
||||
|
||||
return result;
|
||||
result = (*ps->ChangePictureTransform) (pPicture, transform);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -349,7 +349,12 @@ typedef struct _PictureScreen {
|
|||
PictFilterAliasPtr filterAliases;
|
||||
int nfilterAliases;
|
||||
|
||||
/**
|
||||
* Called immediately after a picture's transform is changed through the
|
||||
* SetPictureTransform request. Not called for source-only pictures.
|
||||
*/
|
||||
ChangePictureTransformProcPtr ChangePictureTransform;
|
||||
|
||||
ChangePictureFilterProcPtr ChangePictureFilter;
|
||||
DestroyPictureFilterProcPtr DestroyPictureFilter;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue