Commit ccdbc384 authored by Ryan C. Gordon's avatar Ryan C. Gordon

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

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403205
parent e5621bf1
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment