Skip to content

Address Sanitizer is throwing an error for a negative value being left-shifted #108

Description

@kavika13

With the midi track and sound font I am using, when compiling with zig (which enables address sanitizer by default), and playing back my track, I get an error (at runtime) on this line:

case GEN_UINT_ADD15: ((unsigned int*)region)[offset] += amount->shortAmount<<15; return;

I don't remember enough about the low level details of these formats to know that a value of -1 should even happen at this point. So maybe there's a content or decoding problem upstream from this line of code. But the equivalent code used to do a * 32768 instead of a << 15, which would not trip the sanitizer.

The midi content:
https://github.com/kavika13/jumpmanzero/blob/master/JumpmanAssets/sound/title.mid

The sound font:
https://github.com/kavika13/jumpmanzero/blob/master/JumpmanAssets/sound/reality_gmgs_falcomod.sf2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions