[FFmpeg-cvslog] ass_split_section: dont overread array

Michael Niedermayer git at videolan.org
Fri Dec 14 18:19:07 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec 14 18:10:19 2012 +0100| [6ca2465556836d20ab9ea5689960fbf1fbda0e23] | committer: Michael Niedermayer

ass_split_section: dont overread array

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=6ca2465556836d20ab9ea5689960fbf1fbda0e23
---

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

diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c
index 7ee48b4..4ef3092 100644
--- a/libavcodec/ass_split.c
+++ b/libavcodec/ass_split.c
@@ -267,7 +267,8 @@ static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
                     }
             }
         }
-        buf += strcspn(buf, "\n") + 1;
+        buf += strcspn(buf, "\n");
+        buf += !!*buf;
     }
     return buf;
 }



More information about the ffmpeg-cvslog mailing list