File U_05-Fix-shadow-fb-allocation-size-v2.patch of Package xf86-video-fbdev

From: Adam Jackson <ajax@redhat.com>
Date: Wed Jan 4 10:30:08 2017 -0500
Subject: [PATCH 5/13]Fix shadow fb allocation size (v2)
Patch-mainline: Upstream
Git-repo: git://anongit.freedesktop.org/xorg/driver/xf86-video-fbdev
Git-commit: 2c5eba85740e6a7ced8ada0ee45fdd74e4bca364
References: 
Signed-off-by: Max Staudt <mstaudt@suse.de>

->bitsPerPixel is rather obviously eight times too large.

v2: Use ->displayWidth - the pitch - not ->virtualX (Keith Packard)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
---
 src/fbdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/fbdev.c b/src/fbdev.c
index 2c658fe..4309d76 100644
--- a/src/fbdev.c
+++ b/src/fbdev.c
@@ -827,8 +827,8 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
 	fPtr->fbstart = fPtr->fbmem + fPtr->fboff;
 
 	if (fPtr->shadowFB) {
-	    fPtr->shadow = calloc(1, pScrn->virtualX * pScrn->virtualY *
-				  pScrn->bitsPerPixel);
+	    fPtr->shadow = calloc(1, pScrn->displayWidth * pScrn->virtualY *
+				  ((pScrn->bitsPerPixel + 7) / 8));
 
 	    if (!fPtr->shadow) {
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
openSUSE Build Service is sponsored by