From 1193e294e7dbc6f6e9614c94db94ab00c50101d1 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 12 Aug 2025 14:29:39 +0200 Subject: [PATCH] panoramiX: XineramaGetImageData(): scope `sizeNeeded` variable Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/panoramiX.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index d43675deca..b3bca7c52f 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -1138,12 +1138,10 @@ XineramaGetImageData(DrawablePtr *pDrawables, { RegionRec SrcRegion, GrabRegion; BoxRec SrcBox; - int size, sizeNeeded; + int size = 0; DrawablePtr pDraw = pDrawables[0]; char *ScratchMem = NULL; - size = 0; - /* find box in logical screen space */ SrcBox.x1 = left; SrcBox.y1 = top; @@ -1198,7 +1196,7 @@ XineramaGetImageData(DrawablePtr *pDrawables, int w = pbox->x2 - pbox->x1; int h = pbox->y2 - pbox->y1; int ScratchPitch = PixmapBytePad(w, depth); - sizeNeeded = ScratchPitch * h; + int sizeNeeded = ScratchPitch * h; if (sizeNeeded > size) { char *tmpdata = ScratchMem;