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>
pull/53/head
Clément Bœsch 11 years ago committed by Michael Niedermayer
parent 6b18a6839b
commit b84a7330af
  1. 3
      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;
}

Loading…
Cancel
Save