[FFmpeg-cvslog] avcodec/srtdec: fix potential overread.

Clément Bœsch git at videolan.org
Mon Sep 16 21:43:06 CEST 2013


ffmpeg | branch: release/1.2 | Clément Bœsch <u at pkh.me> | Sun Sep  8 18:28:11 2013 +0200| [0a55c882cb6bef5617ea7150c61889272aa08e5e] | committer: Alexander Strasser

avcodec/srtdec: fix potential overread.

(cherry picked from commit 3a54c221d574ec944db1eddf9df895808f32bf9e)

Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>

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

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

diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
index 267561c..b16645a 100644
--- a/libavcodec/srtdec.c
+++ b/libavcodec/srtdec.c
@@ -204,7 +204,8 @@ static const char *read_ts(const char *buf, int *ts_start, int *ts_end,
                        "%*[ ]X1:%u X2:%u Y1:%u Y2:%u",
                        &hs, &ms, &ss, ts_start, &he, &me, &se, ts_end,
                        x1, x2, y1, y2);
-        buf += strcspn(buf, "\n") + 1;
+        buf += strcspn(buf, "\n");
+        buf += !!*buf;
         if (c >= 8) {
             *ts_start = 100*(ss + 60*(ms + 60*hs)) + *ts_start/10;
             *ts_end   = 100*(se + 60*(me + 60*he)) + *ts_end  /10;



More information about the ffmpeg-cvslog mailing list