Skip to content
  • Bruce Cherniak's avatar
    swr: Fixed an uncommon freed-memory access during state validation · d473f917
    Bruce Cherniak authored and George Kyriazis's avatar George Kyriazis committed
    
    
    State validation is performed during clear and draw calls.  Validation
    during clear was still accessing vertex buffer state.  When the currently
    set vertex buffers are client arrays, this could lead to accessing freed
    memory.  Such is the case with the VMD application.
    
    Previously, vertex buffer validation depended on a dirty bit or the
    draw info indicating an indexed draw.  This required special handling for
    clears.  But, vertex buffer validation still occurred which was unnecessary
    and wrong.
    
    Now, only minimal validation is performed during clear, deferring the
    remainder to the next draw.  And, by setting the dirty bit in swr_draw_vbo
    for indexed draws, vertex buffer validation is only dependent upon a
    single dirty bit.
    
    This fixes a bug exposed by the VMD application when changing models.
    
    Reviewed-By: default avatarGeorge Kyriazis <george.kyriazis@intel.com>
    d473f917