From 7d8ba1867da07e657c4e58b85515d0bf16995dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 28 Dec 2020 09:24:10 +0200 Subject: 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 --- data/freedesktop.org.xml.in | 51 ++++++++++++++++++++++++++++++++------------- 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. - - - - - + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + - - - + + + + + - - - + + + + + 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 -- cgit v1.2.1