:: commit d85e6302db82df9e5b9b929211cc9525aff19d44

mintsuki <mintsuki@protonmail.com> — 2021-07-10 23:24

parents: b5ef61f151

Revert "bmp: Sanity check images"

This reverts commit 8ea847e563292da39a5589eb6aaaf877dda81e67.
diff --git a/stage23/lib/bmp.c b/stage23/lib/bmp.c
index 1b381c56..a299caac 100644
--- a/stage23/lib/bmp.c
+++ b/stage23/lib/bmp.c
@@ -40,10 +40,7 @@ int bmp_open_image(struct image *image, struct file_handle *file) {
     if (memcmp(&header.bf_signature, "BM", 2) != 0)
         return -1;
 
-    if ((header.bi_bpp != 32) && (header.bi_bpp != 24))
-        return -1;
-
-    if (header.bi_compression)
+    if ((header.bi_bpp < 8) | ((header.bi_bpp % 8) != 0))
         return -1;
 
     struct bmp_local *local = ext_mem_alloc(sizeof(struct bmp_local));
tab: 248 wrap: offon