~ubuntu-branches/ubuntu/precise/mesa/precise-security

« back to all changes in this revision

Viewing changes to src/gallium/drivers/r300/r300_emit.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers, Steve Beattie
  • Date: 2012-10-19 09:04:04 UTC
  • mfrom: (163.1.4 precise-proposed)
  • Revision ID: package-import@ubuntu.com-20121019090404-5zbjpsp6knv7zl3b
Tags: 8.0.4-0ubuntu0.2
[ Steve Beattie ]
* SECURITY UPDATE: samplers array overflow (LP: #1046933)
  - debian/patches/50-CVE-2012-2864.patch: ensure that more than
    MAX_SAMPLERS are not used
  - CVE-2012-2864

Show diffs side-by-side

added added

removed removed

Lines of Context:
1030
1030
            R300_PVS_VF_MAX_VTX_NUM(12) |
1031
1031
            (r300screen->caps.is_r500 ? R500_TCL_STATE_OPTIMIZATION : 0));
1032
1032
 
1033
 
    /* Emit flow control instructions. */
1034
 
    if (code->num_fc_ops) {
1035
 
 
1036
 
        OUT_CS_REG(R300_VAP_PVS_FLOW_CNTL_OPC, code->fc_ops);
1037
 
        if (r300screen->caps.is_r500) {
1038
 
            OUT_CS_REG_SEQ(R500_VAP_PVS_FLOW_CNTL_ADDRS_LW_0, code->num_fc_ops * 2);
1039
 
            OUT_CS_TABLE(code->fc_op_addrs.r500, code->num_fc_ops * 2);
1040
 
        } else {
1041
 
            OUT_CS_REG_SEQ(R300_VAP_PVS_FLOW_CNTL_ADDRS_0, code->num_fc_ops);
1042
 
            OUT_CS_TABLE(code->fc_op_addrs.r300, code->num_fc_ops);
1043
 
        }
1044
 
        OUT_CS_REG_SEQ(R300_VAP_PVS_FLOW_CNTL_LOOP_INDEX_0, code->num_fc_ops);
1045
 
        OUT_CS_TABLE(code->fc_loop_index, code->num_fc_ops);
 
1033
    /* Emit flow control instructions.  Even if there are no fc instructions,
 
1034
     * we still need to write the registers to make sure they are cleared. */
 
1035
    OUT_CS_REG(R300_VAP_PVS_FLOW_CNTL_OPC, code->fc_ops);
 
1036
    if (r300screen->caps.is_r500) {
 
1037
        OUT_CS_REG_SEQ(R500_VAP_PVS_FLOW_CNTL_ADDRS_LW_0, R300_VS_MAX_FC_OPS * 2);
 
1038
        OUT_CS_TABLE(code->fc_op_addrs.r500, R300_VS_MAX_FC_OPS * 2);
 
1039
    } else {
 
1040
        OUT_CS_REG_SEQ(R300_VAP_PVS_FLOW_CNTL_ADDRS_0, R300_VS_MAX_FC_OPS);
 
1041
        OUT_CS_TABLE(code->fc_op_addrs.r300, R300_VS_MAX_FC_OPS);
1046
1042
    }
 
1043
    OUT_CS_REG_SEQ(R300_VAP_PVS_FLOW_CNTL_LOOP_INDEX_0, R300_VS_MAX_FC_OPS);
 
1044
    OUT_CS_TABLE(code->fc_loop_index, R300_VS_MAX_FC_OPS);
1047
1045
 
1048
1046
    END_CS;
1049
1047
}