On 04/08/13 08:51, Vinson Lee wrote:
> Fixes "Uninitialized pointer read" defect reported by Coverity.
> 
> Signed-off-by: Vinson Lee <v...@freedesktop.org>
Hi Vinson

This patch looks remarkably similar to the one I've sent a few weeks ago
- with yours having a lot better commit message :)

The way I see it (after a subtle hint from calim) this patch improves
the issue from "accessing undefined variable/array(ptr)" to
"array out of bounds" - sample_index must be zero but the caller can
choose a different value.

IMHO the most suitable approach would be to provide undefined data to
the caller (same as what the intel code does), like show below.


     case 8: ptr = ms8; break;
+#ifndef NDEBUG
       assert(0);
       break;
+#else
+      return;
+#endif

Cheers
Emil
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to