Heap Corruption Detected, Free list canary is damaged


#1

I'm not sure what's causing it, but i am getting a bunch of these malloc: errors when i'm calling getStringWidth() for a font that's loaded into memory.   any ideas where to start looking?   

my code isn't triggering it directly.  the Juce::OSXTypeFace::getStringWidth() method is triggering it from:

juce::JuceNSViewClass::drawRect()
juce::NSViewComponentPeer::draw..
juce::Component::paintEntireComponent()
juce::Component::paintComponent()
juce::DocumentWindow::paint()
juce::LookAndFeel_V2::drawDocum...
juce::Font::getStringWidth()
juce::Font::getStringWidthFloat()
juce::OSXTypeFace::getStringWidth() {
     float x = 0;
        if (ctFontRef != nullptr && text.isNotEmpty())
        {
            CFStringRef cfText = text.toCFString();
            CFAttributedStringRef attribString = CFAttributedStringCreate (kCFAllocatorDefault, cfText, attributedStringAtts);
            CFRelease (cfText);
            CTLineRef line = CTLineCreateWithAttributedString (attribString);  <-- this line triggers the malloc crash

edit:  this turned out to be a std::vector<> problem with a vector that I wasn't properly accessing.