pygame is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

pygame / pygame http://pygame.org/

Clone this repository (size: 15.4 MB): HTTPS / SSH
hg clone https://bitbucket.org/pygame/pygame
hg clone ssh://hg@bitbucket.org/pygame/pygame

Issues

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

Reported by qbradq (last edited )

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.

Status: open Responsible: nobody Type: bug Priority: major
Milestone: 1.9.2 Component: Surface Version: 1.9.1

Attachments

Comments and changes

  1. #1 Lenard Lindstrom

    written

    • Changed milestone from nothing to 1.9.2.

    @qbradq, could you provide a simple test case?

  2. #2 qbradq

    written

    • Changed content.
  3. #3 qbradq

    written

    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.

  4. #4 rdeaton

    written

    Patch (Feel free to comment on style, function placement, or similar. Getting familiar with the pygame codebase).

  5. #5 illume

    written

    • Changed status from new to open.

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

  6. #6 Sagie Maoz

    written

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

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

    Attaching the patch file.

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?