diff options
author | Topi Pohjolainen <[email protected]> | 2018-04-06 10:41:26 +0300 |
---|---|---|
committer | Topi Pohjolainen <[email protected]> | 2018-04-11 01:49:56 +0300 |
commit | 98d38747543277cf931499a6b66626ac644b1865 (patch) | |
tree | f5f387e59219c2720307b2d7e7eb733c800f9e13 /src/mesa/main | |
parent | 26f48fe01092e2fb05daaa5090ac69f8a86a2cfd (diff) |
mesa: Assert base format before truncating to unsigned short
CID: 1433709
Fixes: ca721b3d8: mesa: use GLenum16 in a few more places
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/teximage.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 8f5351085c5..f560512fb48 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -845,6 +845,7 @@ _mesa_init_teximage_fields_ms(struct gl_context *ctx, mesa_format format, GLuint numSamples, GLboolean fixedSampleLocations) { + const GLint base_format =_mesa_base_tex_format(ctx, internalFormat); GLenum target; assert(img); assert(width >= 0); @@ -852,8 +853,8 @@ _mesa_init_teximage_fields_ms(struct gl_context *ctx, assert(depth >= 0); target = img->TexObject->Target; - img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat ); - assert(img->_BaseFormat != -1); + assert(base_format != -1); + img->_BaseFormat = (GLenum16)base_format; img->InternalFormat = internalFormat; img->Border = border; img->Width = width; |