Bug 42542 - [i965] wrong sizeof argument src/mesa/drivers/dri/i965/gen7_viewport_state.c:40
Summary: [i965] wrong sizeof argument src/mesa/drivers/dri/i965/gen7_viewport_state.c:40
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: Kenneth Graunke
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 00:39 UTC by Vinson Lee
Modified: 2012-01-23 11:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
0001-i965-Fix-Coverity-wrong-sizeof-argument-defect.patch (948 bytes, patch)
2011-11-03 00:39 UTC, Vinson Lee
Details | Splinter Review

Description Vinson Lee 2011-11-03 00:39:29 UTC
Created attachment 53094 [details] [review]
0001-i965-Fix-Coverity-wrong-sizeof-argument-defect.patch

mesa: 9f7b6a39f6ebc070ff5020578cea2d299b21d476 (master)

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

src/mesa/drivers/dri/i965/gen7_viewport_state.c
    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;
    39  
    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.