Commit graph

26 commits

Author SHA1 Message Date
Haelwenn (lanodan) Monnier
f9a2078c0f Add SPDX-License-Identifier: HPND-sell-variant
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxcursor/-/merge_requests/25>
2025-06-16 12:32:52 +02:00
Thomas E. Dickey
b00d7da27b
use resized-parameter where available when loading images
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2024-11-03 18:57:23 -05:00
Alan Coopersmith
a353f02a7a If O_CLOEXEC is defined, add "e" to fopen modes
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-25 12:14:36 -07:00
Thomas E. Dickey
801925839d
more cppcheck-style fixes
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2021-05-06 20:12:37 -04:00
Thomas E. Dickey
fb377b9a71
amend that...
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2021-03-11 20:25:40 -05:00
Thomas E. Dickey
362fdcfc3e
add check in case the image size is 0x0
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2021-03-11 20:25:34 -05:00
Thomas E. Dickey
09f69a8829
fix stricter gcc warnings using casts
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2021-03-11 20:25:29 -05:00
Thomas E. Dickey
7623dae73c
fix a missing initializer
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2021-03-11 20:25:03 -05:00
Thomas E. Dickey
cea72e1427
quiet normal gcc warnings using casts (no object change)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2021-03-11 20:24:54 -05:00
Alan Coopersmith
edf52212a0 Fix some clang integer sign/size mismatch warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-10-18 10:52:49 -07:00
Alan Coopersmith
8229cf75b3 XcursorImageLoadCursor: return failure if _XcursorGetDisplayInfo fails
Error: Null pointer dereference (CWE 476)
   Read from null pointer 'info'
        at line 615 of src/cursor.c in function 'XcursorImageLoadCursor'.
          Function '_XcursorGetDisplayInfo' may return constant 'NULL' at line 134, called at line 597.
          Null pointer introduced at line 134 of src/display.c in function '_XcursorGetDisplayInfo'.

[ This bug was found by the Parfait 0.3.7 bug checking tool.
  For more information see http://labs.oracle.com/projects/parfait/ ]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-30 18:59:43 -08:00
Alan Coopersmith
e086eb1bf4 Strip trailing whitespace
Performed with: find * -type f | xargs perl -i -p -e 's{\s+$}{\n}'
git diff -w & git diff -b show no diffs from this change

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-16 21:26:17 -07:00
Alan Coopersmith
4ce23fcd97 Mark bitmasks as unsigned ints
Clears Sun compiler warnings from shifting 8 bits by 24 bits:
"cursor.c", line 215: warning: integer overflow detected: op "<<"
"cursor.c", line 280: warning: integer overflow detected: op "<<"

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-05-22 12:55:31 -07:00
Jeremy Huddleston
047993c76a Correct error handling in _XcursorAverageColor
Previously it would either div-zero or get stuck in a loop until int overflow
if called with a bad value.

cursor.c:214:32: warning: Division by zero
    return (0xff << 24) | ((red/npixels) << 16) | ((green/npixels) << 8) | (blue/npixels);

Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-07 10:16:18 -07:00
Matthieu Herrb
04641d3cc3 nuke RCS Ids 2008-03-09 00:34:36 +01:00
Alan Coopersmith
9df9640643 Fix many sparse warnings: Using plain integer as NULL pointer 2006-10-10 14:57:16 -07:00
Chris Wilson
e0a501e91c fix leak in header destruction
Fix a couple of if (!foo) free(foo); tests.
2006-08-12 19:55:44 +03:00
Daniel Stone
caa910e492 Import Xcursor 1.1.4 from freedesktop.org xlibs tree. 2005-06-29 18:46:53 +00:00
Daniel Stone
e67de73f5c Bug #1043: Fix leak when creating animated cursors. 2005-06-13 16:44:53 +00:00
Markus Kuhn
50911b052c Encoding of numerous files changed to UTF-8 2004-12-04 00:42:47 +00:00
Egbert Eich
cbcf471d91 Merging XORG-CURRENT into trunk 2004-04-23 18:43:40 +00:00
Egbert Eich
fb1739bd22 Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 2004-03-14 08:32:05 +00:00
Egbert Eich
bfcfbe061f Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 2004-03-03 12:11:23 +00:00
Egbert Eich
c450b74503 readding XFree86's cvs IDs 2004-02-26 13:35:32 +00:00
Egbert Eich
79b8e8b996 Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 2004-02-26 09:22:42 +00:00
Kaleb Keithley
3b84b14bf0 Initial revision 2003-11-14 16:48:48 +00:00