pygame.Surface.fill() does not respect surface clipping rect or surface bounds

Issue #101 resolved
Norman Lancaster created an issue

While using Surface.fill() to do a little debugging I started getting corrupted surface data, and eventual program crashes. This turned out to be caused by the fill() call not respecting the clipping rect (or even the dimensions of) the surface.

When writing the test program I found that this only occurs when special flags are specified, however it occurs with ALL special flags, not just one.

Comments (9)

  1. Norman Lancaster reporter

    Sorry for the late reply, I apparently do not have email notification set up correctly.

    I have attached a simple test program that illustrates that all .fill calls that specify any special flag do not respect the clipping rect. This is a test app and not a unit test unfortunately. I've never done unit testing, might be a good opportunity to learn :D

    So my guess is this will go back to the SDL upstream.

  2. René Dudfield
    • changed status to open

    @qbradq : there is a file called test/ where you can put your test in as a unit test... if you want to.

  3. Sagie Maoz

    Hi, I've added a test class to based on the provided test case.

    It successfully breaks with the current code base, and passes with @rdeaton's patch.

    Attaching the patch file.

  4. Log in to comment