Skip to content

Commit

Permalink
chafa: Accept JPEG files starting with a COM segment
Browse files Browse the repository at this point in the history
Fixes #245 (GitHub).
  • Loading branch information
hpjansson committed Jan 27, 2025
1 parent 05e7609 commit bf2be02
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/chafa/jpeg-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,16 @@ have_any_apptype_magic (FileMapping *mapping)

for (n = 0xe0; n <= 0xef; n++)
{
magic [3] = n;
magic [3] = n; /* APPn */
if (file_mapping_has_magic (mapping, 0, magic, 4))
return TRUE;
}

magic [3] = 0xdb;
magic [3] = 0xdb; /* DQT */
if (file_mapping_has_magic (mapping, 0, magic, 4))
return TRUE;

magic [3] = 0xfe; /* COM */
return file_mapping_has_magic (mapping, 0, magic, 4);
}

Expand Down

0 comments on commit bf2be02

Please sign in to comment.