Skip to content

GS DT1 SysEx checksum calculation is subtly incorrect #1578

@RoqueDeicide

Description

@RoqueDeicide

FluidSynth version

This bug has been present since FluidSynth 2.2.0beta1 to this day.

Describe the bug

When checksum is calculated, its 8th bit is not masked out before verification. Because of this, if checksum & 0x7F ends up equal to 0, the result will end up being 0x80, but the checksum, as recorded in the SysEx can only range from 0x00 to 0x7F, preventing validation.

Expected behavior

Checksum should be bitwise ANDed by 0x7F, before being compared with the checksum in the SysEx message.

Steps to reproduce

Send 0xF0 0x41 0x10 0x42 0x12 0x40 0x1D 0x23 0x00 0x00 0xF7 SysEx message to FluidSynth, it will get rejected even before realizing, that it's not supported.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions