[fix] string copy allocated in function params can be destroyed before access via *end pointer causing EXC_BAD_ACCESS
[fix] ffmpeg uses a 16-byte stride when scaling images, which can overrun the texture buffer which is only 2-byte aligned, causing a segfault on OSX/iOS
Merge pull request #2991 from night199uk/misc

[fixes] Fix a couple of EXC_BAD_ACCESS memory access bugs on OSX that cause real instability