|
|
I got it (but no correction yet)
The issue is in disp_sdl.cpp, UnixSDLDisplay::SetPixelScaled
unsigned int ix = x * m_display_scale;
unsigned int iy = y * m_display_scale;
is returning values which combined with
Uint8 *p = (Uint8 *) m_display->pixels + iy * m_display->pitch + ix *
m_display->format->BytesPerPixel;
get p out of the m_display->pixels array. (and ofs out of PxCount array too)
(BytesPerPixel in my case is 4)
m_display_scale is a float, but m_display->pitch is an integer.
I guess that the current m_display_scale is a round-up representation of
the number m_display_scale = float(width) / GetWidth();
(line 245)
Round-up, because the representation of the exact value is not possible.
And btw, the code does not seems to handle a huge height when width is
small enough)
So, a small exaggeration on the ratio generates a memory corruption when
the display is on and scaled.
Post a reply to this message
|
|