diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index 1490dbaff8..7afbc6c39e 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -90,7 +90,10 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs, { n1--; // skip the ending '0' while ( p < n1 ) - data[p++] = (NSOpenGLPixelFormatAttribute) GLAttrs[p]; + { + data[p] = (NSOpenGLPixelFormatAttribute) GLAttrs[p]; + p++; + } } if ( ctxAttrs && n2 > 1 )