Commit a8be8a8c authored by hybrid's avatar hybrid

Merge from 1.7 branch, revisions 3515-3533. createImage memleak fixed. TGA loader fixed.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3534 dfc29bdd-3216-0410-991c-e03cc46cb475
parent f1cc2dca
...@@ -52,7 +52,10 @@ void CImage::initData() ...@@ -52,7 +52,10 @@ void CImage::initData()
Pitch = BytesPerPixel * Size.Width; Pitch = BytesPerPixel * Size.Width;
if (!Data) if (!Data)
{
DeleteMemory=true;
Data = new u8[Size.Height * Pitch]; Data = new u8[Size.Height * Pitch];
}
} }
......
...@@ -133,7 +133,7 @@ bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param) ...@@ -133,7 +133,7 @@ bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param)
if (file->write(&imageFooter, sizeof(imageFooter)) < (s32)sizeof(imageFooter)) if (file->write(&imageFooter, sizeof(imageFooter)) < (s32)sizeof(imageFooter))
return false; return false;
return imageHeader.ImageHeight < y; return imageHeader.ImageHeight <= y;
} }
} // namespace video } // namespace video
......
...@@ -839,7 +839,8 @@ void COpenGLDriver::clearBuffers(bool backBuffer, bool zBuffer, bool stencilBuff ...@@ -839,7 +839,8 @@ void COpenGLDriver::clearBuffers(bool backBuffer, bool zBuffer, bool stencilBuff
if (stencilBuffer) if (stencilBuffer)
mask |= GL_STENCIL_BUFFER_BIT; mask |= GL_STENCIL_BUFFER_BIT;
glClear(mask); if (mask)
glClear(mask);
} }
......
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