Fix serious bug in Image.cpp

This commit is contained in:
Pavel Krajcevski 2014-03-18 19:37:26 -04:00
parent 83588a0c97
commit ff210ed741

View File

@ -93,8 +93,10 @@ Image<PixelType>::Image(const Image<PixelType> &other)
, m_Height(other.m_Height) , m_Height(other.m_Height)
, m_Pixels(new PixelType[GetNumPixels()]) , m_Pixels(new PixelType[GetNumPixels()])
{ {
if(other.m_Pixels) {
memcpy(m_Pixels, other.m_Pixels, GetNumPixels() * sizeof(PixelType)); memcpy(m_Pixels, other.m_Pixels, GetNumPixels() * sizeof(PixelType));
} }
}
template<typename PixelType> template<typename PixelType>
bool Image<PixelType>::ReadPixels(const uint32 *rgba) { bool Image<PixelType>::ReadPixels(const uint32 *rgba) {