We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1535 - SDL_UpdateWindowRects() SIGSEGV on X11 (shared memory) with out-of-bound rects
Summary: SDL_UpdateWindowRects() SIGSEGV on X11 (shared memory) with out-of-bound rects
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All FreeBSD
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-03 04:21 UTC by Marcus von Appen
Modified: 2012-07-05 04:27 UTC (History)
0 users

See Also:


Attachments
Test program (534 bytes, text/plain)
2012-07-03 04:21 UTC, Marcus von Appen
Details
Patch for clipping the rects to the window bounds (2.44 KB, patch)
2012-07-03 04:21 UTC, Marcus von Appen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus von Appen 2012-07-03 04:21:10 UTC
Created attachment 895 [details]
Test program

Using SDL_UpdateWindowRects () with SDL_Rect instances, that do not clip
to the bounds of the SDL_Window, causes a BadValue error on X11, if shared
memory is enabled:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  142 (MIT-SHM)
  Minor opcode of failed request:  3 (X_ShmPutImage)
  Value in failed request:  0x5
  Serial number of failed request:  67
  Current serial number in output stream:  70

Attached is a test program to recreate the behaviour along with a simple
patch for SDL_x11framebuffer.c, which reduces the rect area to the window
bounds.

I am not sure, if XPutImage() is more robust here, so I applied it to the
non-shared memory version, too.
Comment 1 Marcus von Appen 2012-07-03 04:21:48 UTC
Created attachment 896 [details]
Patch for clipping the rects to the window bounds
Comment 2 Sam Lantinga 2012-07-05 04:27:52 UTC
Looks good, thanks!
http://hg.libsdl.org/SDL/rev/8f5535d05e34