OSDN Git Service

llvmpipe: Fix incorrect sizeof.
authorVinson Lee <vlee@freedesktop.org>
Thu, 29 Nov 2012 06:36:30 +0000 (22:36 -0800)
committerVinson Lee <vlee@freedesktop.org>
Fri, 30 Nov 2012 05:08:48 +0000 (21:08 -0800)
Fixes sizeof not portable defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/llvmpipe/lp_state_fs.c

index 83933bb..d6a05d2 100644 (file)
@@ -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);