Akira-Hayasaka / ofxGLEditor

Script editor for oF Live Coding
GNU General Public License v2.0
100 stars 16 forks source link

Fix invalid read when applying color scheme #14

Closed munshkr closed 9 years ago

munshkr commented 9 years ago

This fixes a possible segfault caused by an invalid read. Sometimes textColor was still a NULL value.

danomatika commented 9 years ago

What circumstances were causing this? I assume enabling highlighting without setting a color scheme?

EDIT: Actually it's not possible to highlight without a color scheme, by design. I think this is mainly being caused on spaces etc, so I'll just set it to the default text color.

munshkr commented 9 years ago

Yes, I'm not sure what's the text that actually causes the segfault, but I suspect it is an unhandled character, or something like that?

I took the syntax highlight example and changed the color scheme a bit, and it almost always segfaults when I press PageDown. I'll look into it a bit more and let you know.

danomatika commented 9 years ago

I reworded the font color setting so this shouldn't happen. It will be in a commit pretty soon. I don't want to just ignore it like in the PR because it should be able to handle that situation. It might be related to the whitespace chars.

munshkr commented 9 years ago

Oh, ok! I'll close this then. Thanks!