[Spice-devel] [PATCH qxl-wddm-dod v2 08/25] Use SrcPitch when calculating size of memory to map PresentDisplayOnly

Sameeh Jubran sameeh at daynix.com
Mon Sep 5 08:34:05 UTC 2016


From: Sandy Stutsman <sstutsma at redhat.com>

Can result in a BSOD, as the image would be mapped only partially causing page faults when
accessing missing piece of the image.

Acked-by: Frediano Ziglio <fziglio at redhat.com>
---
 qxldod/QxlDod.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index fae5c92..15037b3 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -3641,7 +3641,7 @@ QxlDevice::ExecutePresentDisplayOnly(
 
     {
         // Map Source into kernel space, as Blt will be executed by system worker thread
-        UINT sizeToMap = SrcBytesPerPixel * ctx->SrcWidth * ctx->SrcHeight;
+        UINT sizeToMap = ctx->SrcPitch * ctx->SrcHeight;
 
         PMDL mdl = IoAllocateMdl((PVOID)SrcAddr, sizeToMap,  FALSE, FALSE, NULL);
         if(!mdl)
-- 
2.7.0.windows.1



More information about the Spice-devel mailing list