0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
mpv/player
wm4 9a210ca2d5 Audit and replace all ctype.h uses
Something like "char *s = ...; isdigit(s[0]);" triggers undefined
behavior, because char can be signed, and thus s[0] can be a negative
value. The is*() functions require unsigned char _or_ EOF. EOF is a
special value outside of unsigned char range, thus the argument to the
is*() functions can't be a char.

This undefined behavior can actually trigger crashes if the
implementation of these functions e.g. uses lookup tables, which are
then indexed with out-of-range values.

Replace all <ctype.h> uses with our own custom mp_is*() functions added
with misc/ctype.h. As a bonus, these functions are locale-independent.
(Although currently, we _require_ C locale for other reasons.)
2014-07-01 23:11:08 +02:00
..
lua player: make the time display relative to start PTS 2014-06-29 20:39:49 +02:00
timeline Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
audio.c audio: add a "weak" gapless mode, and make it default 2014-06-09 01:20:53 +02:00
client.c Add more const 2014-06-11 00:39:14 +02:00
client.h Add more const 2014-06-11 00:39:14 +02:00
command.c player: make the time display relative to start PTS 2014-06-29 20:39:49 +02:00
command.h command: redo the property type 2014-06-13 02:11:39 +02:00
configfiles.c Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
core.h player: make the time display relative to start PTS 2014-06-29 20:39:49 +02:00
discnav.c discnav: make OSD path explicitly thread-safe 2014-06-16 01:00:53 +02:00
loadfile.c options: allow adding multiple files with --audio-file 2014-06-18 01:58:05 +02:00
lua.c Basic xdg directory implementation 2014-06-26 19:37:25 +02:00
main_fn.c build: add option to build a library 2014-02-10 21:25:22 +01:00
main.c Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
misc.c player: fix start position when specifying with percent 2014-06-29 20:39:49 +02:00
osd.c player: make the time display relative to start PTS 2014-06-29 20:39:49 +02:00
playloop.c player: make the time display relative to start PTS 2014-06-29 20:39:49 +02:00
screenshot.c player: make the time display relative to start PTS 2014-06-29 20:39:49 +02:00
screenshot.h Move mpvcore/player/ to player/ 2013-12-17 00:53:22 +01:00
scripting.c scripting: shorten a line 2014-06-26 19:56:45 +02:00
sub.c sub: fix undefined behavior with dvd:// 2014-06-28 15:55:24 +02:00
video.c video: correct spelling: mp_image_params_equals -> mp_image_params_equal 2014-06-17 23:30:27 +02:00