Next Generation Emulation banner
1 - 3 of 3 Posts

· Registered
Joined
·
3 Posts
Discussion Starter · #1 ·
Hi,

I am new to this forum, though I have been using VisualBoy Advance SDL version for developing games for a year now.

I have always had a crash problem when either entering or exiting the emulator (version 1.7.2). I have searched forums but never found info on this. So I decided to download the 1.7.2-source and find the problem myself.

Turns out there's a memory leak in the 'pix' buffer when running in 32-bit display mode. I corrected the buffer size and the crash has gone.

The only change was in line 2265 of SDL.cpp :

pix = (u8 *)calloc(1, 4 * 241 * 162);


This cures the problem. Thought others might be interested.

Regards
Anders Emil
 

· Registered
Joined
·
3 Posts
Discussion Starter · #2 ·
Btw, just checked the CVS repository, the problem is still there. Just thought someone might have the time to fix it. There must be a lot of folks out there still running 16-bit or 24-bit modes since nearly noone have mentioned this? ;)
 

· Registered
Joined
·
3 Posts
Discussion Starter · #5 ·
Yes you are right, wrong header, sorry about that. Buffer overrun it is, indeed. The only filter I usually use is a simple 2x, haven't actually tested if the bug happens in any other sizes, or with other filters. I just noticed that the buffer dimensions allocated were smaller than the ones being used to index it.
 
1 - 3 of 3 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top