Bug of function SW_UpdateClipRect at file SDL_render_sw.c

All,
I think there is a bug about type convertion error here:
static int
SW_UpdateClipRect(SDL_Renderer * renderer)
{
const SDL_Rect *rect = &renderer->clip_rect;

  • SDL_Surface* framebuffer = (SDL_Surface *) renderer->driverdata;
  • SDL_Surface* framebuffer = ((SW_RenderData
    *)renderer->driverdata)->surface;
    if (!SDL_RectEmpty(rect)) {
    SDL_SetClipRect(framebuffer, rect);
    } else {
    SDL_SetClipRect(framebuffer, NULL);
    }
    return 0;
    }

actually, the original type of renderer->driverdata is (SW_RenderData *)
not (SDL_Surface *), right?

Yup! Fixed, thanks!On Thu, Jun 27, 2013 at 3:21 AM, imaoge wrote:

All,
I think there is a bug about type convertion error here:
static int
SW_UpdateClipRect(SDL_Renderer * renderer)
{
const SDL_Rect *rect = &renderer->clip_rect;

  • SDL_Surface* framebuffer = (SDL_Surface *) renderer->driverdata;
  • SDL_Surface* framebuffer = ((SW_RenderData
    *)renderer->driverdata)->surface;
    if (!SDL_RectEmpty(rect)) {
    SDL_SetClipRect(framebuffer, rect);
    } else {
    SDL_SetClipRect(framebuffer, NULL);
    }
    return 0;
    }

actually, the original type of renderer->driverdata is (SW_RenderData *)
not (SDL_Surface *), right?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org