# HG changeset patch # User Ryan C. Gordon # Date 1220859521 0 # Node ID 3411fb673d4bff01606e0153cce82a3e72c95482 # Parent e3affc66d963ca53c24f3aae2f0eaa7a1838dd35 Merged r4082:4083 from branches/SDL-1.2: sparc64 crash fix. diff -r e3affc66d963 -r 3411fb673d4b src/video/Xext/Xxf86vm/XF86VMode.c --- a/src/video/Xext/Xxf86vm/XF86VMode.c Sat Sep 06 04:31:34 2008 +0000 +++ b/src/video/Xext/Xxf86vm/XF86VMode.c Mon Sep 08 07:38:41 2008 +0000 @@ -210,6 +210,13 @@ 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 @@ _XRead(dpy, (char *) modeline->private, modeline->privsize * sizeof(INT32)); } else { - modeline->private = NULL; + zap_ptr((char *)&modeline->private, sizeof(modeline->private)) } UnlockDisplay(dpy); SyncHandle();