DragonFlyBSD Kernel Audit
DF-1859 / fix.diff
← back to finding ↓ download raw
diff --git a/dev/video/fb/bmp/splash_bmp.c b/dev/video/fb/bmp/splash_bmp.c
--- a/dev/video/fb/bmp/splash_bmp.c
+++ b/dev/video/fb/bmp/splash_bmp.c
@@ -535,7 +535,7 @@
     bmp_info.ncols = (bmf->bmfi.bmiHeader.biClrUsed);
     bzero(bmp_info.palette,sizeof(bmp_info.palette));
     if (bmp_info.ncols == 0) {	/* uses all of them */
-	bmp_info.ncols = 1 << bmf->bmfi.bmiHeader.biBitCount;
+	bmp_info.ncols = 1U << (bmf->bmfi.bmiHeader.biBitCount & 31);
     }
     if ((bmp_info.height > bmp_info.sheight) ||
 	(bmp_info.width > bmp_info.swidth) ||