<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Looks good to me.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Neha Bhende<bhenden@vmware.com><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p>Regards,</p>
<p>Neha<br>
</p>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Charmaine Lee <charmainel@vmware.com><br>
<b>Sent:</b> Friday, July 6, 2018 4:09:02 PM<br>
<b>To:</b> mesa-dev@lists.freedesktop.org<br>
<b>Cc:</b> Brian Paul; Neha Bhende; Charmaine Lee<br>
<b>Subject:</b> [PATCH] st/wgl: check for NULL piAttribList in wglCreatePbufferARB()</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Java2d opengl pipeline passes NULL piAttribList to<br>
wglCreatePbufferARB(). So skip parsing the attribute list<br>
if it is NULL.<br>
---<br>
 src/gallium/state_trackers/wgl/stw_ext_pbuffer.c | 80 ++++++++++++------------<br>
 1 file changed, 41 insertions(+), 39 deletions(-)<br>
<br>
diff --git a/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c b/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c<br>
index d709faa..02ccb76 100644<br>
--- a/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c<br>
+++ b/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c<br>
@@ -101,45 +101,47 @@ wglCreatePbufferARB(HDC hCurrentDC,<br>
       return 0;<br>
    }<br>
 <br>
-   for (piAttrib = piAttribList; *piAttrib; piAttrib++) {<br>
-      switch (*piAttrib) {<br>
-      case WGL_PBUFFER_LARGEST_ARB:<br>
-         piAttrib++;<br>
-         useLargest = *piAttrib;<br>
-         break;<br>
-       case WGL_TEXTURE_FORMAT_ARB:<br>
-          /* WGL_ARB_render_texture */<br>
-          piAttrib++;<br>
-          textureFormat = *piAttrib;<br>
-          if (textureFormat != WGL_TEXTURE_RGB_ARB &&<br>
-             textureFormat != WGL_TEXTURE_RGBA_ARB &&<br>
-             textureFormat != WGL_NO_TEXTURE_ARB) {<br>
-             SetLastError(ERROR_INVALID_DATA);<br>
-             return 0;<br>
-          }<br>
-          break;<br>
-       case WGL_TEXTURE_TARGET_ARB:<br>
-          /* WGL_ARB_render_texture */<br>
-          piAttrib++;<br>
-          textureTarget = *piAttrib;<br>
-          if (textureTarget != WGL_TEXTURE_CUBE_MAP_ARB &&<br>
-              textureTarget != WGL_TEXTURE_1D_ARB &&<br>
-              textureTarget != WGL_TEXTURE_2D_ARB &&<br>
-              textureTarget != WGL_NO_TEXTURE_ARB) {<br>
-             SetLastError(ERROR_INVALID_DATA);<br>
-             return 0;<br>
-          }<br>
-          break;<br>
-      case WGL_MIPMAP_TEXTURE_ARB:<br>
-         /* WGL_ARB_render_texture */<br>
-         piAttrib++;<br>
-         textureMipmap = !!*piAttrib;<br>
-         break;<br>
-      default:<br>
-         SetLastError(ERROR_INVALID_DATA);<br>
-         debug_printf("wgl: Unsupported attribute 0x%x in %s\n",<br>
-                      *piAttrib, __func__);<br>
-         return 0;<br>
+   if (piAttribList) {<br>
+      for (piAttrib = piAttribList; *piAttrib; piAttrib++) {<br>
+         switch (*piAttrib) {<br>
+         case WGL_PBUFFER_LARGEST_ARB:<br>
+            piAttrib++;<br>
+            useLargest = *piAttrib;<br>
+            break;<br>
+          case WGL_TEXTURE_FORMAT_ARB:<br>
+             /* WGL_ARB_render_texture */<br>
+             piAttrib++;<br>
+             textureFormat = *piAttrib;<br>
+             if (textureFormat != WGL_TEXTURE_RGB_ARB &&<br>
+                textureFormat != WGL_TEXTURE_RGBA_ARB &&<br>
+                textureFormat != WGL_NO_TEXTURE_ARB) {<br>
+                SetLastError(ERROR_INVALID_DATA);<br>
+                return 0;<br>
+             }<br>
+             break;<br>
+          case WGL_TEXTURE_TARGET_ARB:<br>
+             /* WGL_ARB_render_texture */<br>
+             piAttrib++;<br>
+             textureTarget = *piAttrib;<br>
+             if (textureTarget != WGL_TEXTURE_CUBE_MAP_ARB &&<br>
+                 textureTarget != WGL_TEXTURE_1D_ARB &&<br>
+                 textureTarget != WGL_TEXTURE_2D_ARB &&<br>
+                 textureTarget != WGL_NO_TEXTURE_ARB) {<br>
+                SetLastError(ERROR_INVALID_DATA);<br>
+                return 0;<br>
+             }<br>
+             break;<br>
+         case WGL_MIPMAP_TEXTURE_ARB:<br>
+            /* WGL_ARB_render_texture */<br>
+            piAttrib++;<br>
+            textureMipmap = !!*piAttrib;<br>
+            break;<br>
+         default:<br>
+            SetLastError(ERROR_INVALID_DATA);<br>
+            debug_printf("wgl: Unsupported attribute 0x%x in %s\n",<br>
+                         *piAttrib, __func__);<br>
+            return 0;<br>
+         }<br>
       }<br>
    }<br>
 <br>
-- <br>
1.9.1<br>
<br>
</div>
</span></font></div>
</body>
</html>