Commit Graph

7 Commits

Author SHA1 Message Date
Paul B Mahol 13df9bfbcb avutil/avsscanf: fix possible overreads when dealing with %c or %s 2020-12-02 13:54:53 +01:00
Michael Niedermayer 42b28565aa avutil/avsscanf: Add () to avoid integer overflow in scanexp()
Fixes: signed integer overflow: 2147483610 + 52 cannot be represented in type 'int'
Fixes: 23260/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-5187871274434560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-01 11:41:35 +02:00
Paul B Mahol be60dc2145 avutil/avsscanf: do not use long double functions
Not needed when only double is used.
2018-12-15 09:58:28 +01:00
Paul B Mahol 7d70f09307 avutil/avsscanf: do not use unsupported p suffix for hex variable 2018-11-22 10:09:05 +01:00
Paul B Mahol 277fd9c2ac avutil/avsscanf: use ptrdiff_t instead of off_t 2018-11-19 15:16:36 +01:00
Carl Eugen Hoyos 529debc987 lavu/avsscanf: Do not mix declaration and code.
Fixes the following warning:
libavutil/avsscanf.c: In function 'decfloat':
libavutil/avsscanf.c:354:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
         int bitlim = bits-3*(int)(rp-9);
         ^~~
2018-11-18 03:51:42 +01:00
Paul B Mahol 4b30726dd3 lavu: add locale-independent sscanf implementation
Copied and adopted from musl implementation.
 * converted all 'long double' to 'double'
 * removed %m support
2018-11-16 20:24:52 +01:00