瀏覽代碼

Merge pull request #4662 from IllusionMan1212/jpeg-detection

fix(core/image): off-by-one index when detecting certain JPEG images
Laytan 8 月之前
父節點
當前提交
73d1427127
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/image/general.odin

+ 1 - 1
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
 		}