Fix for corrupted texture issue: https://github.com/cocos2d/cocos2d-x/issues/2550

This fixes the issue described.