<p dir="ltr">Seems reasonable,</p>
<p dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></p>
<div class="gmail_extra"><br><div class="gmail_quote">On Aug 29, 2016 11:43 AM, "Brian Paul" <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We need to set the need_convert flag with each loop iteration, not<br>
just when the rgba pointer is null.<br>
<br>
Bug reported by Markus Müller <<a href="mailto:mueller@imfusion.de">mueller@imfusion.de</a>> on mesa-users list.<br>
Fixes new piglit arb_texture_float-get-tex3d test.<br>
<br>
Cc: <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.<wbr>freedesktop.org</a>><br>
---<br>
 src/mesa/main/texgetimage.c | 14 ++++++++------<br>
 1 file changed, 8 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c<br>
index bd44c68..b900278 100644<br>
--- a/src/mesa/main/texgetimage.c<br>
+++ b/src/mesa/main/texgetimage.c<br>
@@ -495,13 +495,15 @@ get_tex_rgba_uncompressed(<wbr>struct gl_context *ctx, GLuint dimensions,<br>
           */<br>
          if (format == rgba_format) {<br>
             rgba = dest;<br>
-         } else if (rgba == NULL) { /* Allocate the RGBA buffer only once */<br>
+         } else {<br>
             need_convert = true;<br>
-            rgba = malloc(height * rgba_stride);<br>
-            if (!rgba) {<br>
-               _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage()");<br>
-               ctx->Driver.UnmapTextureImage(<wbr>ctx, texImage, img);<br>
-               return;<br>
+            if (rgba == NULL) { /* Allocate the RGBA buffer only once */<br>
+               rgba = malloc(height * rgba_stride);<br>
+               if (!rgba) {<br>
+                  _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage()");<br>
+                  ctx->Driver.UnmapTextureImage(<wbr>ctx, texImage, img);<br>
+                  return;<br>
+               }<br>
             }<br>
          }<br>
<br>
--<br>
1.9.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div>