Unhandled exception in for loop

烂漫一生 提交于 2019-12-02 13:10:35

Please read the manuals of the libraries you're using.

Loading images with stb wrote:

The fifth parameter of stbi_load() specifies the number of 8-bit components per pixel to use. It can be set to one of following four options:

STBI_grey = 1

STBI_grey_alpha = 2

STBI_rgb = 3

STBI_rgb_alpha = 4

If you pass 0 as the fifth parameter stbi_load() will use your nrChannels which is uninitialized in your code and thuss causes undefined behaviour.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!