On 11/28/2012 11:52 PM, Vinson Lee wrote:
Fixes sizeof not portable defects reported by Coverity.

Signed-off-by: Vinson Lee<v...@freedesktop.org>
---
  src/gallium/drivers/llvmpipe/lp_state_fs.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c 
b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index d702fc0..36ef1af 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -1158,7 +1158,7 @@ convert_to_blend_type(struct gallivm_state *gallivm,
     unsigned pixels = 16 / num_srcs;
     bool is_arith;

-   memcpy(dst, src, sizeof(LLVMValueRef*) * num_srcs);
+   memcpy(dst, src, sizeof(LLVMValueRef) * num_srcs);

     lp_mem_type_from_format_desc(src_fmt,&mem_type);
     lp_blend_type_from_format_desc(src_fmt,&blend_type);
@@ -1260,7 +1260,7 @@ convert_from_blend_type(struct gallivm_state *gallivm,
     unsigned pixels = 16 / num_srcs;
     bool is_arith;

-   memcpy(dst, src, sizeof(LLVMValueRef*) * num_srcs);
+   memcpy(dst, src, sizeof(LLVMValueRef) * num_srcs);

     lp_mem_type_from_format_desc(src_fmt,&mem_type);
     lp_blend_type_from_format_desc(src_fmt,&blend_type);

Looks good. Should probably be tagged as a candidate for the stable branches.

Reviewed-by: Brian Paul <bri...@vmware.com>

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

Reply via email to