Malloc(): smallbin double linked list corrupted:

I’m re-sizing an ofFbo framebuffer according to a slider value. Then I attempt to write to the frameBuffer, but it seems that before I can get that far I get a

malloc(): smallbin double linked list corrupted:

and then a huge list of lines beginning with a memory address like:
7f2e1d118000-7f2e1d119000 rw-p 0000a000 08:05 1582829 /usr/lib/x86_64-linux-gnu/
7f2e1d119000-7f2e1d11e000 r-xp 00000000 08:05 1581575 /usr/lib/x86_64-linux-gnu/

…or, I get a segfault.

…or it works absolutely fine, and my graphics get redrawn without a fault.

Is there something I should know about memory management using ofFbo framebuffer objects? I enclose a screenshot of it working, where each track is stretched by a different amount (this is an audio waveform drawing routine I am working on).

Any clues? Its intermittent nature makes it hard to debug…