Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Buffer overrun?

Author
Message
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 10th Nov 2009 18:33
I am using the stdio file functions and i am getting a buffer overrun error. It is reading the data correctly, and there are no error getting returned from ferror. here's the read code:



Anyone have any ideas? i know the file was saved the same way it is being loaded.

New Site! Check it out \/
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Nov 2009 20:09
Quote: "memset(pTileSet, 0, 256);"


pTileSet is not big enough?

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 10th Nov 2009 21:50
Sorry should have mentioned. I already tested that. it's not it. it has something to do with the reading of the file. i //'ed(don't know the name for that) out the reading commands and it ran. Yes the file is large enough. If you would like the file i can upload it.

New Site! Check it out \/
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Nov 2009 22:49 Edited at: 10th Nov 2009 22:49
A buffer overrun is not caused by reading past the end of a file. My guess would be the 'fread(pTileSet, sizeof(char), bufferSize, file);' because it reads 'bufferSize' number of elements into an array. Try debugging, and see what the value of 'bufferSize' is at that point.

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 11th Nov 2009 02:04 Edited at: 11th Nov 2009 02:06
It had to do with the paste image function not liking value of 0. that coupled with some wrong values meant, well, it was sending 0 for the image number.

Got it fixed. thanks for your help though!

New Site! Check it out \/

Login to post a reply

Server time is: 2024-10-01 16:45:38
Your offset time is: 2024-10-01 16:45:38