Signed integer overflow in juce_VST3PluginFormat.cpp

Just a little heads up from the undefined behaviour sanitizer, FYI:

JUCE/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp:88:24: runtime error: signed integer overflow: -80035043 * 31 cannot be represented in type 'int'

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior JUCE/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp:88:24 in


JUCE/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp:218:22: runtime error: load of value 88, which is not a valid value for type 'bool'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior JUCE/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp:218:22 in 


I’ve pushed a fix for the first here:

I’m not seeing the second one though, even with an AudioPlayHead set… I don’t see how it could occur either, isLooping is a bool which we’re checking and then it just sets the ProcessContext flags.

1 Like

That’s great, thank you! That’s exactly what I had in mind to fix it.

The second one I don’t understand either. I just dumped the output I found in my console. Unfortunately the UBsan doesn’t stop, just log. So that’s all information I have.

So far I didn’t experience any problem with it, so I’d ignore it for time being…