From 60dc405defde63ca67251c368bfce6433fc25231 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 2 Sep 2025 12:04:14 +0200 Subject: [PATCH] render: ProcRenderQueryPictFormats(): scope pFormat variable instead of reusing one variable for different things, put it into local scopes, so things can't ever get mixed up. Signed-off-by: Enrico Weigelt, metux IT consult --- render/render.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/render/render.c b/render/render.c index 8d5eaf35dd..146523924d 100644 --- a/render/render.c +++ b/render/render.c @@ -308,7 +308,6 @@ ProcRenderQueryPictFormats(ClientPtr client) VisualPtr pVisual; DepthPtr pDepth; int v, d; - PictFormatPtr pFormat; int nformat; int ndepth; int nvisual; @@ -376,6 +375,7 @@ ProcRenderQueryPictFormats(ClientPtr client) PictureScreenPtr ps = GetPictureScreenIfSet(walkScreen); if (ps) { size_t idx; + PictFormatPtr pFormat; for (idx = 0, pFormat = ps->formats; idx < ps->nformats; idx++, pFormat++) { pictForm->id = pFormat->id; @@ -421,6 +421,8 @@ ProcRenderQueryPictFormats(ClientPtr client) pDepth = walkScreen->allowedDepths + d; pictDepth->nPictVisuals = 0; /* counting in here */ for (v = 0; v < pDepth->numVids; v++) { + PictFormatPtr pFormat; + pVisual = findVisual(walkScreen, pDepth->vids[v]); if (pVisual && (pFormat = PictureMatchVisual(walkScreen, pDepth->depth,