1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-02 01:20:54 +00:00

Fix a misaligned access crash when running on sparc64 and using a

remote X11 display.

Approved by:	maintainer
Obtained from:	upstream SVN
This commit is contained in:
Christian Weisgerber 2008-09-24 18:04:08 +00:00
parent c372e8bf76
commit 05fbdfa2d1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=220721
2 changed files with 31 additions and 1 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= sdl
PORTVERSION= 1.2.13
PORTREVISION= 1
PORTREVISION= 2
PORTEPOCH= 2
CATEGORIES= devel
MASTER_SITES= http://www.libsdl.org/release/

View File

@ -0,0 +1,30 @@
--- src/video/x11/SDL_x11modes.c.orig
+++ src/video/x11/SDL_x11modes.c
@@ -52,8 +52,25 @@
#if SDL_VIDEO_DRIVER_X11_VIDMODE
Bool SDL_NAME(XF86VidModeGetModeInfo)(Display *dpy, int scr, SDL_NAME(XF86VidModeModeInfo) *info)
{
- SDL_NAME(XF86VidModeModeLine) *l = (SDL_NAME(XF86VidModeModeLine)*)((char*)info + sizeof info->dotclock);
- return SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, (int*)&info->dotclock, l);
+ Bool retval;
+ int dotclock;
+ SDL_NAME(XF86VidModeModeLine) l;
+ SDL_memset(&l, 0, sizeof(l));
+ retval = SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, &dotclock, &l);
+ info->dotclock = dotclock;
+ info->hdisplay = l.hdisplay;
+ info->hsyncstart = l.hsyncstart;
+ info->hsyncend = l.hsyncend;
+ info->htotal = l.htotal;
+ info->hskew = l.hskew;
+ info->vdisplay = l.vdisplay;
+ info->vsyncstart = l.vsyncstart;
+ info->vsyncend = l.vsyncend;
+ info->vtotal = l.vtotal;
+ info->flags = l.flags;
+ info->privsize = l.privsize;
+ info->private = l.private;
+ return retval;
}
#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */