Add mismatch check for glGetTexImage or it will return -1 and may lead to segment...