From 08ffc507c09fbf6b478e34ff039d5ff1afabe143 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 20 May 2020 15:21:20 +0200 Subject: [PATCH] midifile: fix CLAMP range of minor/mayor keys --- src/tools/midifile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/midifile.c b/src/tools/midifile.c index b6e3d5998..244ac922e 100644 --- a/src/tools/midifile.c +++ b/src/tools/midifile.c @@ -676,8 +676,8 @@ int midi_file_dump_event(FILE *out, const struct midi_event *ev) fprintf(out, "Key Signature: %d %s: %s", abs(sf), sf > 0 ? "sharps" : "flats", ev->data[4] == 0 ? - major_keys[SPA_CLAMP(sf + 9, 0, 19)] : - minor_keys[SPA_CLAMP(sf + 9, 0, 19)]); + major_keys[SPA_CLAMP(sf + 9, 0, 18)] : + minor_keys[SPA_CLAMP(sf + 9, 0, 18)]); break; } case 0x7f: