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 <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-09-02 12:04:14 +02:00
committed by Enrico Weigelt
parent 8237dacffe
commit 60dc405def

View File

@@ -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,