Next Generation Emulation banner
1 - 5 of 5 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
·
50 Posts
Strange, I never had any problem (and my comp is in 32bit display mode). But anyway, if this fix is ok, I might add it to the cvs sources ;)

Edit : oh maybe you're using some filters in vbasld ? Anyway your fix seems to be ok, as it makes the sdl's pix initialisation be the same than the gba.cpp's pix initialisation, which seems pretty logical. Nice catch anyway ;) !
 

· 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 - 5 of 5 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