Skip to content

Conversation

kblaschke
Copy link
Member

Fixed two issues leading to crashes:

  • The projectm_settings struct was not properly initialized, e.g. the font filename pointers potentially contained random data
  • Adding audio data did not work properly due to an incorrect pointer being passed, crashing the plug-in
  • Audio data was passed in the wrong order [LLL][RRR], and is now interleaved to [LR][LR][LR] as projectM expects it.


// Interleave audio data from the two channel buffers
UInt8 interleavedData[kVisualNumWaveformEntries][kVisualMaxDataChannels];
for (auto sample = 0; sample < kVisualNumWaveformEntries; sample++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (auto sample = 0; sample < kVisualNumWaveformEntries; sample++)
for (auto sample = 0; sample < kVisualNumWaveformEntries * kVisualMaxDataChannels; sample+= kVisualMaxDataChannels)

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that would read & write twice the size of the source and destination arrays. kVisualMaxDataChannels is hard-coded to 2 in the header, so it'll never change unless we do it. That correct? Dunno, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants