mirror of
https://github.com/glest/glest-source.git
synced 2025-09-28 00:19:00 +02:00
- lots more code cleanup, using safe buffer size code to avoid buffer overflows
This commit is contained in:
@@ -915,8 +915,8 @@ void Pixmap2D::init(int w, int h, int components) {
|
||||
deletePixels();
|
||||
|
||||
if(getPixelByteCount() <= 0 || (h <= 0 || w <= 0 || components <= 0)) {
|
||||
char szBuf[1024];
|
||||
sprintf(szBuf,"Invalid pixmap dimensions for [%s], h = %d, w = %d, components = %d\n",path.c_str(),h,w,components);
|
||||
char szBuf[8096];
|
||||
snprintf(szBuf,8096,"Invalid pixmap dimensions for [%s], h = %d, w = %d, components = %d\n",path.c_str(),h,w,components);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
pixels= new uint8[(std::size_t)getPixelByteCount()];
|
||||
|
Reference in New Issue
Block a user