From 247384574aa743656e2646abad86f878be83153f Mon Sep 17 00:00:00 2001 From: Hisham Aburaqibah Date: Sun, 5 Jan 2025 13:01:58 +0200 Subject: [PATCH] fix(core/image): off-by-one index when detecting certain JPEG images --- core/image/general.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/image/general.odin b/core/image/general.odin index c4a88407114..e92b54f185a 100644 --- a/core/image/general.odin +++ b/core/image/general.odin @@ -146,7 +146,7 @@ which_bytes :: proc(data: []byte) -> Which_File_Type { case s[6:10] == "JFIF", s[6:10] == "Exif": return .JPEG case s[:3] == "\xff\xd8\xff": - switch s[4] { + switch s[3] { case 0xdb, 0xee, 0xe1, 0xe0: return .JPEG }