Returns early from createTexture if its width or height are zero.

TRAC #21594 Bug=350 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch git-svn-id: https://angleproject.googlecode.com/svn/trunk@1278 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 087e5789
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 1277
#define BUILD_REVISION 1278
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -1912,6 +1912,10 @@ void Texture2D::createTexture()
{
GLsizei width = mImageArray[0].getWidth();
GLsizei height = mImageArray[0].getHeight();
if (!(width > 0 && height > 0))
return; // do not attempt to create d3d textures for nonexistant data
GLint levels = creationLevels(width, height);
D3DFORMAT d3dfmt = mImageArray[0].getD3DFormat();
DWORD d3dusage = GetTextureUsage(d3dfmt, mUsage, false);
......@@ -2472,6 +2476,10 @@ IDirect3DBaseTexture9 *TextureCubeMap::getBaseTexture() const
void TextureCubeMap::createTexture()
{
GLsizei size = mImageArray[0][0].getWidth();
if (!(size > 0))
return; // do not attempt to create d3d textures for nonexistant data
GLint levels = creationLevels(size, 0);
D3DFORMAT d3dfmt = mImageArray[0][0].getD3DFormat();
DWORD d3dusage = GetTextureUsage(d3dfmt, mUsage, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment