Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run-Time Check Failure #1 When Loading PNG image #2

Closed
IkerGimenez opened this issue Jun 6, 2014 · 7 comments
Closed

Run-Time Check Failure #1 When Loading PNG image #2

IkerGimenez opened this issue Jun 6, 2014 · 7 comments
Assignees
Labels

Comments

@IkerGimenez
Copy link

error
When trying to load a .png file using stbi_load, Visual Studio stops execution with a run-time check failure. I'm not sure if this is specifically a Visual Studio 2012 thing or not. All these images fail to load, except the color_map when in release.

color_map
deer_hr
deer_lr
basketball_spherical
basketball_spherical

@Nairou
Copy link

Nairou commented Jun 6, 2014

I've seen this as well. I usually have Visual Studio disable that runtime check for that file, just because I don't understand the source well enough to fix the issue.

@IkerGimenez
Copy link
Author

I disabled the check and the texture ends up appearing corrupted in GPU memory. Maybe I'm doing something wrong?

@SpartanJ
Copy link

SpartanJ commented Jun 6, 2014

Probably the unpack alignment ( the textures load just fine here with stbi ).
Set the unpack alignment to 1: glPixelStorei(GL_UNPACK_ALIGNMENT,1);

@IkerGimenez
Copy link
Author

Never mind, just me being stupid. Was not assigning the uniform correctly.

@nothings nothings added the bug label Jun 6, 2014
@nothings nothings self-assigned this Jun 6, 2014
@nothings
Copy link
Owner

nothings commented Jun 6, 2014

run-time check is worth fixing

@nothings nothings reopened this Jun 6, 2014
@nothings
Copy link
Owner

nothings commented Jun 6, 2014

Attempted to fix every issue like this which was found in a cast that turned up with a search for "= (" or "(stbi_uc)". (Note that those searches may not have found every such cast.)

I can't actually test that the fixes work since I'm not building with the version of MSVC that has these warnings, but the fix is straightforward so I expect it to be right. However, since these warnings only turn up when you execute them, if there are more places with the same issue that didn't turn up in my searches, we'll just have to discover them piecemeal.

Pushed and released as version 1.38

@nothings nothings closed this as completed Jun 6, 2014
@IkerGimenez
Copy link
Author

Can confirm, the issue was resolved in Visual Studio 2012. If I run into anything else I'll let you know. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants