mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-01 09:08:00 +02:00
glamor: silence false positive in glamor_validate_gc()
We know that if gc->tileIsPixel is false, then gc->tile.pixmap must be
a valid pixmap, but gcc's static analyzer doesn't and needs to be told.
Silences false positive reported in #1817:
xwayland-24.1.6/redhat-linux-build/../glamor/glamor_core.c:205:19:
warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2094>
(cherry picked from commit a79bdc495e)
This commit is contained in:
parent
3611931eb3
commit
03b40ee38d
1 changed files with 2 additions and 0 deletions
|
|
@ -200,6 +200,8 @@ glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable)
|
|||
*/
|
||||
if (changes & GCTile) {
|
||||
if (!gc->tileIsPixel) {
|
||||
assert(gc->tile.pixmap != NullPixmap);
|
||||
|
||||
glamor_pixmap_private *pixmap_priv =
|
||||
glamor_get_pixmap_private(gc->tile.pixmap);
|
||||
if ((!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue