fix #3736 (TextureAtlas crash)