ass_split: fix out of array access
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 11 Jan 2013 01:31:04 +0000 (02:31 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 11 Jan 2013 01:31:31 +0000 (02:31 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ass_split.c

index ddf4675..62c8db9 100644 (file)
@@ -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 {