From e828c45bf2912294b3094f5ef21efdb09ece6df5 Mon Sep 17 00:00:00 2001 From: Sandy Stutsman Date: Mon, 2 Nov 2015 14:35:50 -0500 Subject: [PATCH] Use SrcPitch when calculating size of memory to map PresentDisplayOnly 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 --- qxldod/QxlDod.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp index 37650db..43cf8eb 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)