From 6ca2465556836d20ab9ea5689960fbf1fbda0e23 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 14 Dec 2012 18:10:19 +0100 Subject: ass_split_section: dont overread array Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/ass_split.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libavcodec/ass_split.c') diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c index 7ee48b4a5c..4ef3092cf8 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; } -- cgit v1.2.3