On my system vga_draw_graphic is called with a surface_width(surface) = 1280, the next time surface_width(surface) = 1024, and then the next time again with surface_width(surface) = 1280. So it's a quick resolution change. Each time the surface pointer changes as well as surface_width(surface) and surface_data(surface). Do NOT try to access the s->last_surface with surface_data(s->last_surface) -- it likely has been freed already.
So my guess is we could add (a subset of) checks like this one here:
On my system vga_draw_graphic is called with a surface_ width(surface) = 1280, the next time surface_ width(surface) = 1024, and then the next time again with surface_ width(surface) = 1280. So it's a quick resolution change. Each time the surface pointer changes as well as surface_ width(surface) and surface_ data(surface) . Do NOT try to access the s->last_surface with surface_ data(s- >last_surface) -- it likely has been freed already.
So my guess is we could add (a subset of) checks like this one here:
if (s->last_surface != surface || last_surface_ width != surface_ width(surface) || last_surface_ height != surface_ height( surface) || last_surface_ data != surface_ data(surface) ) {
s->
s->
s->
s->last_surface = surface; last_surface_ width = surface_ width(surface) ;
s->
...
full_update = 1;
}