From 4d4cc4dc14993a533b032acae8862deeb9d695d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 3 Oct 2012 08:59:04 +0200 Subject: 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 --- src/opengl/qglpixelbuffer_win.cpp | 5 +++-- 1 file 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()); -- cgit v0.12