summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@digia.com>2012-10-03 06:59:04 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-12 00:19:36 (GMT)
commit4d4cc4dc14993a533b032acae8862deeb9d695d2 (patch)
tree881f46d5647f86b6e31a5f6c0761b89eba072777 /src
parentd5a71b45911f4d5fde0a5f747c3d2f9c52dfdbc1 (diff)
downloadQt-4d4cc4dc14993a533b032acae8862deeb9d695d2.zip
Qt-4d4cc4dc14993a533b032acae8862deeb9d695d2.tar.gz
Qt-4d4cc4dc14993a533b032acae8862deeb9d695d2.tar.bz2
Fixed potential crash in wglCreatePbufferARB() on Windows.
The spec doesn't allow for the piAttribList parameter to be 0. Task-number: QTBUG-27331 Change-Id: I75da84789cf8044e9283bbab29b6435b0d352f22 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qglpixelbuffer_win.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/opengl/qglpixelbuffer_win.cpp b/src/opengl/qglpixelbuffer_win.cpp
index 37a3ac8..5b7c934 100644
--- a/src/opengl/qglpixelbuffer_win.cpp
+++ b/src/opengl/qglpixelbuffer_win.cpp
@@ -303,12 +303,13 @@ bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidge
// a 2D RGBA texture target.
int pb_attribs[] = {WGL_TEXTURE_FORMAT_ARB, WGL_TEXTURE_RGBA_ARB,
WGL_TEXTURE_TARGET_ARB, WGL_TEXTURE_2D_ARB, 0};
+ int pb_attribs_null[] = {0};
pbuf = wglCreatePbufferARB(dc, pixel_format, size.width(), size.height(),
- has_render_texture ? pb_attribs : 0);
+ has_render_texture ? pb_attribs : pb_attribs_null);
if (!pbuf) {
// try again without the render_texture extension
- pbuf = wglCreatePbufferARB(dc, pixel_format, size.width(), size.height(), 0);
+ pbuf = wglCreatePbufferARB(dc, pixel_format, size.width(), size.height(), pb_attribs_null);
has_render_texture = false;
if (!pbuf) {
qWarning("QGLPixelBuffer: Unable to create pbuffer [w=%d, h=%d] - giving up.", size.width(), size.height());