Fix segfault in Sprite/NinePatch.