diff options
author | Sean Harmer <sean.harmer.qnx@kdab.com> | 2012-07-31 14:09:15 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-01 15:37:46 +0200 |
commit | b23c37358d2240919d618c0435420645567ebaf3 (patch) | |
tree | a727991cba775e9dcbff1cd45af6b64641fe5ba6 /src/plugins/platforms/qnx/qqnxglcontext.cpp | |
parent | 89a1a943cecc2a8d39c88d64bcbee6cf5e02519e (diff) |
QNX: Ensure that the QQnxWindow has a valid size for EGL surfaces
If QWindow::create() gets called before resize() or setGeometry() then
the rect argument passed into QQnxWindow::setGeometry() by the ctor
is null.
This could potentially result in 0 sized buffers and EGL surface
creation being attempted. We bail out in this case and tell
user how to fix their application.
Change-Id: Ia709dba617fa266bd66b61409bdb1c980acfb1a2
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Kevin Ottens <kevin.ottens.qnx@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxglcontext.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxglcontext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index 44935f7e36..7940156994 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -319,6 +319,10 @@ void QQnxGLContext::createSurface(QPlatformSurface *surface) // Fetch the surface size from the window and update // the window's buffers before we create the EGL surface const QSize surfaceSize = platformWindow->requestedBufferSize(); + if (!surfaceSize.isValid()) { + qFatal("QQNX: Trying to create 0 size EGL surface. " + "Please set a valid window size before calling QOpenGLContext::makeCurrent()"); + } platformWindow->setBufferSize(surfaceSize); // Obtain the native handle for our window |