From 97b1ba696baa1bb87415bad244533ac2beaf3568 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 11 Jan 2013 02:31:04 +0100 Subject: ass_split: fix out of array access Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/ass_split.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavcodec') diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c index ddf4675acd..62c8db91a5 100644 --- a/libavcodec/ass_split.c +++ b/libavcodec/ass_split.c @@ -250,7 +250,9 @@ static const char *ass_split_section(ASSSplitContext *ctx, const char *buf) ptr = struct_ptr + section->fields[order[i]].offset; convert_func[type](ptr, buf, len); } - buf = skip_space(buf + len + !last); + buf += len; + if (!last && *buf) buf++; + buf = skip_space(buf); } } } else { -- cgit v1.2.3