[Bf-blender-cvs] [1a3928f33c7] master: Fix T75546: Solve possible endless loop in wintab initialisation

Nicholas Rishel noreply at git.blender.org
Fri Apr 10 00:43:16 CEST 2020


Commit: 1a3928f33c76074a8d59eeca2b58187774cd7b4e
Author: Nicholas Rishel
Date:   Thu Apr 9 16:43:09 2020 -0600
Branches: master
https://developer.blender.org/rB1a3928f33c76074a8d59eeca2b58187774cd7b4e

Fix T75546: Solve possible endless loop in wintab initialisation

Some Wintab drivers report a zero length queue, this causes an unplanned never ending loop.

Differential Revision: https://developer.blender.org/D7392
Reviewed by: Ray Molenkamp

===================================================================

M	intern/ghost/intern/GHOST_WindowWin32.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index d4fe7af8861..1ca0dd47cbe 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -1072,11 +1072,10 @@ void GHOST_WindowWin32::initializeWintab()
     // Wintab provides no way to determine the maximum queue size aside from checking if attempts
     // to change the queue size are successful.
     const int maxQueue = 500;
-    int initialQueueSize = m_wintab.queueSizeGet(m_wintab.context);
-    int queueSize = initialQueueSize;
+    int queueSize = m_wintab.queueSizeGet(m_wintab.context);
 
     while (queueSize < maxQueue) {
-      int testSize = min(queueSize + initialQueueSize, maxQueue);
+      int testSize = min(queueSize + 16, maxQueue);
       if (m_wintab.queueSizeSet(m_wintab.context, testSize)) {
         queueSize = testSize;
       }



More information about the Bf-blender-cvs mailing list