January 1st, 2014, 11:20 AM
Memory problem on loading compressed bmp
Hey all happy new year, first post but second account on this forum sadly I was unable to retrieve my old one but never mind!
I took over a project a couple of months ago (delphi 2007) and been having some real fun making a video game however some of the compressed bmp image libraries are causing the application to terminate or become unresponsive when specific images are accessed in the libraries.
I am relatively new to programming and I guess pretty ignorant so I am looking for some obvious pointers to debug this problem.
So, in a little more detail the game loads compressed bmps from various data libraries and decompresses them for use. However some of (maybe 1 in 100 images) cause the program to crash. It is always the same images but the program doesn't always crash when loading them it does things like:
1) Load the image then crash
2) Not load the image then crash
3) Either of the above but continue to run for a while and loading any other image my crash it
Something else I have noticed is if the faulty image is loaded after a greater number of other images have been loaded then it doesn't crash right away - maybe something to do with reusing the memory where it was loaded? Free and nil problem maybe?
The crashes are typically "this program has stopped responding" but sometimes it just terminates with no error, and I have also had:
The instruction at 0x73363cbb referenced memory at 0x00000018 the memory could not be read
The instruction at 0x774948b3 referenced memory at 0x006b5abd the memory could not be read
The instruction at 0x774a5a3b referenced memory at 0x000008d5 the memory could not be read
Hope this post is not too much of a mess and someone can give me a few pushes in the right direction