diff options
author | marha <marha@users.sourceforge.net> | 2009-12-10 07:43:34 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-12-10 07:43:34 +0000 |
commit | 0540eb5a1f795c0f5265d244ec979b8ddfcf3acb (patch) | |
tree | 06c5c3f4394f2d6d48c95ed1bfbab3a44e9996cc /xorg-server/hw/xquartz/xpr/xprCursor.c | |
parent | 5c72c54bc068bf12007dc15b353b1b2795e9aaf5 (diff) | |
parent | 75d2bbcf0f39b9c85bc270728343f61dabebce2d (diff) | |
download | vcxsrv-0540eb5a1f795c0f5265d244ec979b8ddfcf3acb.tar.gz vcxsrv-0540eb5a1f795c0f5265d244ec979b8ddfcf3acb.tar.bz2 vcxsrv-0540eb5a1f795c0f5265d244ec979b8ddfcf3acb.zip |
svn merge ^/trunk .
Diffstat (limited to 'xorg-server/hw/xquartz/xpr/xprCursor.c')
-rw-r--r-- | xorg-server/hw/xquartz/xpr/xprCursor.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/xorg-server/hw/xquartz/xpr/xprCursor.c b/xorg-server/hw/xquartz/xpr/xprCursor.c index b577fc099..fbaf825de 100644 --- a/xorg-server/hw/xquartz/xpr/xprCursor.c +++ b/xorg-server/hw/xquartz/xpr/xprCursor.c @@ -95,7 +95,10 @@ load_cursor(CursorPtr src, int screen) const uint32_t *be_data=(uint32_t *) src->bits->argb; unsigned i; rowbytes = src->bits->width * sizeof (CARD32); - data=alloca (rowbytes * src->bits->height); + data = xalloc(rowbytes * src->bits->height); + if(!data) { + FatalError("Failed to allocate memory in %s\n", __func__); + } for(i=0;i<(src->bits->width*src->bits->height);i++) data[i]=ntohl(be_data[i]); #endif @@ -118,8 +121,11 @@ load_cursor(CursorPtr src, int screen) /* round up to 8 pixel boundary so we can convert whole bytes */ rowbytes = ((src->bits->width * 4) + 31) & ~31; - data = alloca(rowbytes * src->bits->height); - + data = xalloc(rowbytes * src->bits->height); + if(!data) { + FatalError("Failed to allocate memory in %s\n", __func__); + } + if (!src->bits->emptyMask) { ycount = src->bits->height; @@ -168,6 +174,7 @@ load_cursor(CursorPtr src, int screen) } err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes); + xfree(data); return err == Success; } |