Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merged r4082:4083 from branches/SDL-1.2: sparc64 crash fix.

  • Loading branch information
icculus committed Sep 8, 2008
1 parent 46b0436 commit ed04d95eae10fcb84241207cff7edb904713c648
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/video/Xext/Xxf86vm/XF86VMode.c
@@ -210,6 +210,13 @@ SDL_NAME(XF86VidModeGetGamma) (Display * dpy, int screen,
return True;
}

/* this is to prevent an unaligned memory write on CPUs that need that. */
static void
zap_ptr(char *ptr, size_t size)
{
memset(ptr, '\0', size);
}

Bool SDL_NAME(XF86VidModeGetModeLine) (dpy, screen, dotclock, modeline)
Display *
dpy;
@@ -285,7 +292,7 @@ SDL_NAME(XF86VidModeModeLine) * modeline;
_XRead(dpy, (char *) modeline->private,
modeline->privsize * sizeof(INT32));
} else {
modeline->private = NULL;
zap_ptr((char *)&modeline->private, sizeof(modeline->private))
}
UnlockDisplay(dpy);
SyncHandle();

0 comments on commit ed04d95

Please sign in to comment.