Skip to content

SDL_BlitSurface segfault #8897

Closed
Closed
@Starbuck5

Description

@Starbuck5

I've been chewing on the SDL 2.29.1 pre-release for a few days now trying to figure out some failures and segfaults in the pygame-ce test suite.

I found that one of our image saving routines was segfaulting, and I tracked it down to SDL_BlitSurface and this commit bb969ac

Here is a minimum reproducible example (this segfaults for me):

SDL_Surface* surface = SDL_CreateRGBSurfaceWithFormat(0, 1, 1, 32, SDL_PIXELFORMAT_ARGB8888);
SDL_Surface* linebuf = SDL_CreateRGBSurfaceWithFormat(0, 1, 1, 32, SDL_PIXELFORMAT_ARGB8888);
SDL_Rect srcrect = {0, 0, 1, 1};
SDL_BlitSurface(surface, &srcrect, linebuf, NULL);

This code lacks a dest rect, and SDL_UpperBlit now sends that NULL through into SDL_LowerBlit, where it didn't previously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions