aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/miext/sync/misync.c1
-rw-r--r--xorg-server/os/utils.c16
-rw-r--r--xorg-server/render/render.c6
3 files changed, 19 insertions, 4 deletions
diff --git a/xorg-server/miext/sync/misync.c b/xorg-server/miext/sync/misync.c
index 932376cf0..f3b711d58 100644
--- a/xorg-server/miext/sync/misync.c
+++ b/xorg-server/miext/sync/misync.c
@@ -167,7 +167,6 @@ SyncCloseScreen (int i, ScreenPtr pScreen)
SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
- free(pScreenPriv);
return (*pScreen->CloseScreen) (i, pScreen);
}
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c
index 260c3a99c..eb3ba91bb 100644
--- a/xorg-server/os/utils.c
+++ b/xorg-server/os/utils.c
@@ -427,7 +427,21 @@ GetTimeInMillis(void)
#ifdef MONOTONIC_CLOCK
struct timespec tp;
- if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+ static clockid_t clockid;
+ if (!clockid) {
+#ifdef CLOCK_MONOTONIC_COARSE
+ if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
+ (tp.tv_nsec / 1000) <= 1000 &&
+ clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
+ clockid = CLOCK_MONOTONIC_COARSE;
+ else
+#endif
+ if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+ clockid = CLOCK_MONOTONIC;
+ else
+ clockid = ~0L;
+ }
+ if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
#endif
diff --git a/xorg-server/render/render.c b/xorg-server/render/render.c
index dd143d6a7..9f1b4701f 100644
--- a/xorg-server/render/render.c
+++ b/xorg-server/render/render.c
@@ -1084,8 +1084,10 @@ ProcRenderAddGlyphs (ClientPtr client)
remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs;
/* protect against bad nglyphs */
- if (gi < stuff || gi > ((CARD32 *)stuff + client->req_len) ||
- bits < stuff || bits > ((CARD32 *)stuff + client->req_len)) {
+ if (gi < ((xGlyphInfo *)stuff) ||
+ gi > ((xGlyphInfo *)((CARD32 *)stuff + client->req_len)) ||
+ bits < ((CARD8 *)stuff) ||
+ bits > ((CARD8 *)((CARD32 *)stuff + client->req_len))) {
err = BadLength;
goto bail;
}