Bug 42542

Summary: [i965] wrong sizeof argument src/mesa/drivers/dri/i965/gen7_viewport_state.c:40
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Drivers/DRI/i965Assignee: Kenneth Graunke <kenneth>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: All   
OS: All   
i915 platform: i915 features:
Attachments: 0001-i965-Fix-Coverity-wrong-sizeof-argument-defect.patch

Description Vinson Lee 2011-11-03 00:39:29 UTC
Created attachment 53094 [details] [review]

mesa: 9f7b6a39f6ebc070ff5020578cea2d299b21d476 (master)

Coverity reported a wrong sizeof defect in the following i965 code.

    29  static void
    30  gen7_upload_sf_clip_viewport(struct brw_context *brw)
    31  {
    32     struct intel_context *intel = &brw->intel;
    33     struct gl_context *ctx = &intel->ctx;
    34     const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
    35     GLfloat y_scale, y_bias;
    36     const bool render_to_fbo = (ctx->DrawBuffer->Name != 0);
    37     const GLfloat *v = ctx->Viewport._WindowMap.m;
    38     struct gen7_sf_clip_viewport *vp;
    40     vp = brw_state_batch(brw, AUB_TRACE_SF_VP_STATE,
->  41                          sizeof(vp), 64, &brw->sf.vp_offset);
Comment 1 Kenneth Graunke 2012-01-23 11:29:56 UTC
commit 3e18ad7fd7026e31fd92fe5cf7097d08e5b9a15a
Author: Vinson Lee <vlee@vmware.com>
Date:   Thu Nov 3 00:36:27 2011 -0700

    i965: Fix Coverity wrong sizeof argument defect.
    NOTE: This is a candidate for stable release branches.
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42542
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.