Thread
:
[resolved] C programming - need help with malloc and free
View Single Post
shocking
2010-07-07 , 11:33
Posts: 8 | Thanked: 2 times | Joined on Jun 2009
#
7
Like Rob1n, I suspect that it's a buffer overrun, Valgrind might help in its detection as fnordianslip suggested. There's a possibility that the bounds check in the for loop might not work the way you think (compiler dependent I believe). It might be evaulating i < surfaceRGBA -> w and then multiplying that by surfaceRGBA -> h, which you could eliminate with i < (surfaceRGBA -> w * surfaceRGBA -> h), but I'm not sure that'd cause the problem.
Quote & Reply
|
shocking
View Public Profile
Send a private message to shocking
Find all posts by shocking