mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 03:30:04 +01:00
glamor: handle allocation failure in glamor_create_pixmap()
Reported by gcc 15.1:
../glamor/glamor.c: In function ‘glamor_create_pixmap’:
../glamor/glamor.c:233:23: warning: potential null pointer dereference
[-Wnull-dereference]
233 | pixmap_priv->type = GLAMOR_TEXTURE_ONLY;
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
../glamor/glamor.c:228:26: warning: potential null pointer dereference
[-Wnull-dereference]
228 | pixmap_priv->is_cbcr = (GLAMOR_CREATE_FORMAT_CBCR & usage) == GLAMOR_CREATE_FORMAT_CBCR;
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2094>
This commit is contained in:
parent
69b48423bd
commit
cc647f2367
1 changed files with 3 additions and 0 deletions
|
|
@ -223,6 +223,9 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
|
||||||
else
|
else
|
||||||
pixmap = fbCreatePixmap(screen, 0, 0, depth, usage);
|
pixmap = fbCreatePixmap(screen, 0, 0, depth, usage);
|
||||||
|
|
||||||
|
if (!pixmap)
|
||||||
|
return NullPixmap;
|
||||||
|
|
||||||
pixmap_priv = glamor_get_pixmap_private(pixmap);
|
pixmap_priv = glamor_get_pixmap_private(pixmap);
|
||||||
|
|
||||||
pixmap_priv->is_cbcr = (GLAMOR_CREATE_FORMAT_CBCR & usage) == GLAMOR_CREATE_FORMAT_CBCR;
|
pixmap_priv->is_cbcr = (GLAMOR_CREATE_FORMAT_CBCR & usage) == GLAMOR_CREATE_FORMAT_CBCR;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue