Skip to content

Commit

Permalink
Merge pull request #4662 from IllusionMan1212/jpeg-detection
Browse files Browse the repository at this point in the history
fix(core/image): off-by-one index when detecting certain JPEG images
  • Loading branch information
laytan authored Jan 5, 2025
2 parents acbb14d + 2473845 commit 73d1427
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/image/general.odin
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 73d1427

Please sign in to comment.