diff options
Diffstat (limited to 'source/Irrlicht/CImageLoaderBMP.cpp')
-rw-r--r-- | source/Irrlicht/CImageLoaderBMP.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/Irrlicht/CImageLoaderBMP.cpp b/source/Irrlicht/CImageLoaderBMP.cpp index 675212b..234c515 100644 --- a/source/Irrlicht/CImageLoaderBMP.cpp +++ b/source/Irrlicht/CImageLoaderBMP.cpp @@ -252,6 +252,12 @@ IImage* CImageLoaderBMP::loadImage(io::IReadFile* file) const return 0;
}
+ if (header.BPP > 32 || !checkImageDimensions(header.Width, header.Height))
+ {
+ os::Printer::log("Rejecting BMP with unreasonable size or BPP.", ELL_ERROR);
+ return 0;
+ }
+
// adjust bitmap data size to dword boundary
header.BitmapDataSize += (4-(header.BitmapDataSize%4))%4;
|