aboutsummaryrefslogtreecommitdiff
path: root/source/Irrlicht/CImageLoaderBMP.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-09-30 16:40:41 +0200
committersfan5 <sfan5@live.de>2021-10-05 11:17:36 +0200
commitdbd39120e7ed8c0c97e48e2df62347627f3c1d42 (patch)
tree15a62e5bfd1338605f9a0ac3e333a37ae654ef3c /source/Irrlicht/CImageLoaderBMP.cpp
parent594de9915346a87f67cd94e28c7933993efb5d3b (diff)
downloadirrlicht-dbd39120e7ed8c0c97e48e2df62347627f3c1d42.tar.xz
Limit dimensions of all image loaders to 23000x23000
Diffstat (limited to 'source/Irrlicht/CImageLoaderBMP.cpp')
-rw-r--r--source/Irrlicht/CImageLoaderBMP.cpp6
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;