diff options
author | Clément Bœsch <u@pkh.me> | 2014-01-10 01:51:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-11 02:28:17 +0100 |
commit | b84a7330af41cec93384bf59ed68c67b09d105cd (patch) | |
tree | 5f29a0138eaccccaefb1e58f1588fd42cf7a551e | |
parent | 6b18a6839b43ea78e70cd3e35f781d1c955bda73 (diff) | |
download | ffmpeg-b84a7330af41cec93384bf59ed68c67b09d105cd.tar.gz |
avformat/pjsdec: dont increase pointer when its already at the end in read_ts()
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f91f2de7764_2649_PJS_capability_tester.pjs
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/pjsdec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/pjsdec.c b/libavformat/pjsdec.c index a69a31660d..6f5db37886 100644 --- a/libavformat/pjsdec.c +++ b/libavformat/pjsdec.c @@ -53,7 +53,8 @@ static int64_t read_ts(char **line, int *duration) int64_t start, end; if (sscanf(*line, "%"SCNd64",%"SCNd64, &start, &end) == 2) { - *line += strcspn(*line, "\"") + 1; + *line += strcspn(*line, "\""); + *line += !!**line; *duration = end - start; return start; } |