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

« back to all changes in this revision

Viewing changes to src/mesa/swrast/s_texture.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:
96
96
      swImg->ImageOffsets[i] = i * width * height;
97
97
   }
98
98
 
 
99
   _swrast_init_texture_image(texImage, width, height, depth);
 
100
 
 
101
   return GL_TRUE;
 
102
}
 
103
 
 
104
 
 
105
/**
 
106
 * Code that overrides ctx->Driver.AllocTextureImageBuffer may use this to
 
107
 * initialize the fields of swrast_texture_image without allocating the image
 
108
 * buffer or initializing ImageOffsets or RowStride.
 
109
 *
 
110
 * Returns GL_TRUE on success, GL_FALSE on memory allocation failure.
 
111
 */
 
112
void
 
113
_swrast_init_texture_image(struct gl_texture_image *texImage, GLsizei width,
 
114
                           GLsizei height, GLsizei depth)
 
115
{
 
116
   struct swrast_texture_image *swImg = swrast_texture_image(texImage);
 
117
 
99
118
   if ((width == 1 || _mesa_is_pow_two(texImage->Width2)) &&
100
119
       (height == 1 || _mesa_is_pow_two(texImage->Height2)) &&
101
120
       (depth == 1 || _mesa_is_pow_two(texImage->Depth2)))
115
134
      swImg->HeightScale = (GLfloat) texImage->Height;
116
135
      swImg->DepthScale = (GLfloat) texImage->Depth;
117
136
   }
118
 
 
119
 
   return GL_TRUE;
120
137
}
121
138
 
122
139