Mesa (master): llvmpipe: Fix incorrect sizeof.

Vinson Lee vlee at kemper.freedesktop.org
Fri Nov 30 05:09:28 UTC 2012


Module: Mesa
Branch: master
Commit: f126f34c1d1726336586da7f5a726546963a0f0a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f126f34c1d1726336586da7f5a726546963a0f0a

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Wed Nov 28 22:36:30 2012 -0800

llvmpipe: Fix incorrect sizeof.

Fixes sizeof not portable defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/drivers/llvmpipe/lp_state_fs.c |    4 ++--
 1 files 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 83933bb..d6a05d2 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -1088,7 +1088,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);
@@ -1190,7 +1190,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);




More information about the mesa-commit mailing list