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
This commit is contained in:

committed by
Ray Molenkamp

parent
5ebbd8f672
commit
1a3928f33c
@@ -1072,11 +1072,10 @@ void GHOST_WindowWin32::initializeWintab()
|
|||||||
// Wintab provides no way to determine the maximum queue size aside from checking if attempts
|
// Wintab provides no way to determine the maximum queue size aside from checking if attempts
|
||||||
// to change the queue size are successful.
|
// to change the queue size are successful.
|
||||||
const int maxQueue = 500;
|
const int maxQueue = 500;
|
||||||
int initialQueueSize = m_wintab.queueSizeGet(m_wintab.context);
|
int queueSize = m_wintab.queueSizeGet(m_wintab.context);
|
||||||
int queueSize = initialQueueSize;
|
|
||||||
|
|
||||||
while (queueSize < maxQueue) {
|
while (queueSize < maxQueue) {
|
||||||
int testSize = min(queueSize + initialQueueSize, maxQueue);
|
int testSize = min(queueSize + 16, maxQueue);
|
||||||
if (m_wintab.queueSizeSet(m_wintab.context, testSize)) {
|
if (m_wintab.queueSizeSet(m_wintab.context, testSize)) {
|
||||||
queueSize = testSize;
|
queueSize = testSize;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user