-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hey, I ran into an issue with this line of code while scanning my music folder.
| if (data.Length >= 2 && data[0] == 0xFF && (data[1] & 0xE0) == 0xE0) |
This condition also matches some non-MP3 files.
For example, desktop.ini files on Windows are often encoded as UTF-16 LE and start with the byte order mark FF FE.
Since 0xFE & 0xE0 == 0xE0, the check evaluates to true and the file is detected as MP3.
So any UTF-16 LE text file could potentially trigger this.
Maybe the MP3 detection could validate additional header bits to avoid false positives.
Thanks for the library
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels