[FFmpeg-cvslog] avformat/pjsdec: dont increase pointer when its already at the end in read_ts()

Clément Bœsch git at videolan.org
Sat Jan 11 02:36:25 CET 2014


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Fri Jan 10 01:51:22 2014 +0100| [b84a7330af41cec93384bf59ed68c67b09d105cd] | committer: 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: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b84a7330af41cec93384bf59ed68c67b09d105cd
---

 libavformat/pjsdec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/pjsdec.c b/libavformat/pjsdec.c
index a69a316..6f5db37 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;
     }



More information about the ffmpeg-cvslog mailing list