Commit b84a7330 authored by Clément Bœsch's avatar Clément Bœsch Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6b18a683
...@@ -53,7 +53,8 @@ static int64_t read_ts(char **line, int *duration) ...@@ -53,7 +53,8 @@ static int64_t read_ts(char **line, int *duration)
int64_t start, end; int64_t start, end;
if (sscanf(*line, "%"SCNd64",%"SCNd64, &start, &end) == 2) { if (sscanf(*line, "%"SCNd64",%"SCNd64, &start, &end) == 2) {
*line += strcspn(*line, "\"") + 1; *line += strcspn(*line, "\"");
*line += !!**line;
*duration = end - start; *duration = end - start;
return start; return start;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment