diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2020-12-28 09:24:10 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2020-12-28 09:36:33 +0200 |
commit | 7d8ba1867da07e657c4e58b85515d0bf16995dc4 (patch) | |
tree | 867dd857c134deceb714750196dc413d979d2f70 | |
parent | f8ce49e4a8978a8e0fd4c62dd86b867ff38b4946 (diff) | |
download | shared-mime-info-7d8ba1867da07e657c4e58b85515d0bf16995dc4.tar.gz |
audio/x-mod: magic match 669 Composer files' tempo table
According to mikmod, the tempo table is 128 bytes containing values
ranging from 1 to 32, inclusive. We don't have good means to test all
those 128 bytes, but look into the last one to make it rule out some
short files. Also, accept 0 for the time being due to our match
expression limitations.
0-31 being ASCII control characters gives this a better chance to avoid
matching random ASCII files out there.
Closes https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/144
-rw-r--r-- | data/freedesktop.org.xml.in | 51 | ||||
-rw-r--r-- | tests/mime-detection/list | 2 |
2 files changed, 37 insertions, 16 deletions
diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in index d45ca833..8bc631df 100644 --- a/data/freedesktop.org.xml.in +++ b/data/freedesktop.org.xml.in @@ -4358,26 +4358,47 @@ command to generate the output files. <!-- 669 composer files: "if" and "JN" --> <match type="byte" value="0x0" mask="0x80" offset="112"> <match type="string" value="if" offset="0"> - <!-- number of samples: 0-63 --> - <match type="byte" value="0x0" mask="0xc0" offset="110"> - <!-- number of patterns: 0-128 --> - <match type="byte" value="0x0" mask="0x80" offset="111"/> - <match type="byte" value="0x80" offset="111"/> + <!-- tempo list last byte: 0-31 (0 = known false positive) --> + <match type="byte" value="0x0" mask="0xe0" offset="368"> + <!-- number of samples: 0-63 --> + <match type="byte" value="0x0" mask="0xc0" offset="110"> + <!-- number of patterns: 0-128 --> + <match type="byte" value="0x0" mask="0x80" offset="111"/> + <match type="byte" value="0x80" offset="111"/> + </match> + <!-- number of samples: 64 --> + <match type="byte" value="0x40" offset="110"> + <match type="byte" value="0x0" mask="0x80" offset="111"/> + <match type="byte" value="0x80" offset="111"/> + </match> </match> - <!-- number of samples: 64 --> - <match type="byte" value="0x40" offset="110"> - <match type="byte" value="0x0" mask="0x80" offset="111"/> - <match type="byte" value="0x80" offset="111"/> + <!-- tempo list last byte: 32 --> + <match type="byte" value="0x20" offset="368"> + <!-- number of samples: 0-63 --> + <match type="byte" value="0x0" mask="0xc0" offset="110"> + <!-- number of patterns: 0-128 --> + <match type="byte" value="0x0" mask="0x80" offset="111"/> + <match type="byte" value="0x80" offset="111"/> + </match> + <!-- number of samples: 64 --> + <match type="byte" value="0x40" offset="110"> + <match type="byte" value="0x0" mask="0x80" offset="111"/> + <match type="byte" value="0x80" offset="111"/> + </match> </match> </match> <match type="string" value="JN" offset="0"> - <match type="byte" value="0x0" mask="0xc0" offset="110"> - <match type="byte" value="0x0" mask="0x80" offset="111"/> - <match type="byte" value="0x80" offset="111"/> + <match type="byte" value="0x0" mask="0xe0" offset="368"> + <match type="byte" value="0x0" mask="0xc0" offset="110"> + <match type="byte" value="0x0" mask="0x80" offset="111"/> + <match type="byte" value="0x80" offset="111"/> + </match> </match> - <match type="byte" value="0x40" offset="110"> - <match type="byte" value="0x0" mask="0x80" offset="111"/> - <match type="byte" value="0x80" offset="111"/> + <match type="byte" value="0x20" offset="368"> + <match type="byte" value="0x40" offset="110"> + <match type="byte" value="0x0" mask="0x80" offset="111"/> + <match type="byte" value="0x80" offset="111"/> + </match> </match> </match> </match> diff --git a/tests/mime-detection/list b/tests/mime-detection/list index 7f3cc099..cb0c8841 100644 --- a/tests/mime-detection/list +++ b/tests/mime-detection/list @@ -531,7 +531,7 @@ simon.669 audio/x-mod # http://modarchive.org/module.php?61261 4jsno.669 audio/x-mod # https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/144 -false-positive-669 text/plain xxx +false-positive-669 text/plain x # Copied from https://github.com/inAudible-NG/audible-samples test.aa audio/x-pn-audibleaudio test.aax audio/vnd.audible.aax |