From b5f4e054febecb1aabfa2be4993bf03b324400aa Mon Sep 17 00:00:00 2001 From: Quajak Date: Sun, 18 Nov 2018 12:32:26 +0100 Subject: [PATCH] Fixed magic number check for bitmap --- source/Cosmos.System2/Graphics/Bitmap.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Cosmos.System2/Graphics/Bitmap.cs b/source/Cosmos.System2/Graphics/Bitmap.cs index db3cec708..e29a010d6 100644 --- a/source/Cosmos.System2/Graphics/Bitmap.cs +++ b/source/Cosmos.System2/Graphics/Bitmap.cs @@ -60,7 +60,7 @@ namespace Cosmos.System.Graphics //reading magic number to identify if BMP file (BM as string - 42 4D as Hex) - bytes 0 -> 2 stream.Read(_short, 0, 2); - if (0x424d != BitConverter.ToInt16(_short, 0)) + if ("42-4D" != BitConverter.ToString(_short)) throw new Exception("Header is not from a BMP"); //read size of BMP file - byte 2 -> 6