Browse Source

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>
tags/n2.2-rc1
Clément Bœsch Michael Niedermayer 11 years ago
parent
commit
b84a7330af
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavformat/pjsdec.c

+ 2
- 1
libavformat/pjsdec.c View File

@@ -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