Prevent a crash when buffer() returns 0
If buffer() returns 0 then there is no bufferPixels available which will cause a crash later on when it tries to set that memory. If this function fails then all we can do is return, a warning will have already been outputted from buffer() itself indicating why. Change-Id: I5890b3c34536f7f3d17def0936970c0a694b005a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>bb10
parent
24a94ab833
commit
9ddcb7784a
|
|
@ -963,7 +963,8 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
|
|||
|
||||
QImage img;
|
||||
if (!haveCachedPixmap) { // If the pixmap is not cached, generate it! -------------------------
|
||||
buffer(w, h); // Ensure a buffer of at least (w, h) in size
|
||||
if (!buffer(w, h)) // Ensure a buffer of at least (w, h) in size
|
||||
return;
|
||||
HDC dc = bufferHDC();
|
||||
|
||||
// Clear the buffer
|
||||
|
|
|
|||
Loading…
Reference in New Issue