1
mirror of https://github.com/mpv-player/mpv synced 2024-11-18 21:16:10 +01:00
mpv/audio
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 ad_lavc: make option struct local 2014-06-11 01:39:51 +02:00
filter af_volume: fix calculations including replay-gain 2014-06-28 15:56:16 +02:00
out Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
audio_buffer.c Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
audio_buffer.h audio: add mp_audio_buffer 2013-11-12 23:28:21 +01:00
audio.c af_fmt2bits: change to af_fmt2bps (bytes/sample) where appropriate 2014-05-28 21:38:00 +02:00
audio.h af_fmt2bits: change to af_fmt2bps (bytes/sample) where appropriate 2014-05-28 21:38:00 +02:00
chmap_sel.c Add more const 2014-06-11 00:39:14 +02:00
chmap_sel.h audio: add channel map selection function 2013-05-12 21:24:57 +02:00
chmap.c Add more const 2014-06-11 00:39:14 +02:00
chmap.h audio: add enum name for speaker id 2014-02-28 20:54:15 +01:00
fmt-conversion.c audio: fix format ID conversion 2013-12-23 21:24:41 +01:00
fmt-conversion.h ad_lavc: use fmt-conversion to map sample formats 2013-04-13 04:21:27 +02:00
format.c af_fmt2bits: change to af_fmt2bps (bytes/sample) where appropriate 2014-05-28 21:38:00 +02:00
format.h af_fmt2bits: change to af_fmt2bps (bytes/sample) where appropriate 2014-05-28 21:38:00 +02:00
mixer.c player: show "neutral" position markers for OSD bars 2014-06-08 23:52:58 +02:00
mixer.h player: show "neutral" position markers for OSD bars 2014-06-08 23:52:58 +02:00