1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 17:42:17 +00:00
mpv/video
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
..
decode options: Expose --colormatrix-primaries to the user 2014-06-22 19:01:25 +02:00
filter vf_dlopen: fix the order of the arguments to mp_image_alloc 2014-06-19 23:07:02 +02:00
out Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
csputils.c video: Include better heuristics for guessing primaries 2014-06-22 19:05:43 +02:00
csputils.h video: Include better heuristics for guessing primaries 2014-06-22 19:05:43 +02:00
fmt-conversion.c video: synchronize mpv rgb pixel format names with ffmpeg names 2014-06-14 10:03:04 +02:00
fmt-conversion.h
hwdec.h
image_writer.c video: introduce failure path for image allocations 2014-06-17 22:43:43 +02:00
image_writer.h
img_format.c video: cosmetics: reformat image format names table 2014-06-14 10:06:23 +02:00
img_format.h video: synchronize mpv rgb pixel format names with ffmpeg names 2014-06-14 10:03:04 +02:00
img_fourcc.h
memcpy_pic.h
mp_image_pool.c video: introduce failure path for image allocations 2014-06-17 22:43:43 +02:00
mp_image_pool.h video: introduce failure path for image allocations 2014-06-17 22:43:43 +02:00
mp_image.c video: Include better heuristics for guessing primaries 2014-06-22 19:05:43 +02:00
mp_image.h video: Add support for non-BT.709 primaries 2014-06-22 19:00:38 +02:00
sws_utils.c video: correct spelling: mp_image_params_equals -> mp_image_params_equal 2014-06-17 23:30:27 +02:00
sws_utils.h options: remove global variables for swscale options; rename them 2014-06-11 00:39:13 +02:00
vaapi.c video: introduce failure path for image allocations 2014-06-17 22:43:43 +02:00
vaapi.h video: warn if an emulated hwdec API is used 2014-05-28 02:08:45 +02:00
vdpau_functions.inc video: warn if an emulated hwdec API is used 2014-05-28 02:08:45 +02:00
vdpau_mixer.c video: correct spelling: mp_image_params_equals -> mp_image_params_equal 2014-06-17 23:30:27 +02:00
vdpau_mixer.h vdpau_mixer: allow overriding frame opts 2014-05-02 01:08:04 +02:00
vdpau.c video: introduce failure path for image allocations 2014-06-17 22:43:43 +02:00
vdpau.h video: warn if an emulated hwdec API is used 2014-05-28 02:08:45 +02:00
vfcap.h