Commit ae514b12 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/ass_split: Change order of operations in ass_split_section()

This matches the other branch
Fixes out of array read
Fixes: 4d142ca76d39fe685effcf5017098723/asan_heap-oob_31ae824_8611_348fdb64f9009b63c8a8eae9a0e497c5.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 1398ded7
...@@ -275,7 +275,7 @@ static const char *ass_split_section(ASSSplitContext *ctx, const char *buf) ...@@ -275,7 +275,7 @@ static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
} }
if (section->format_header && !order) { if (section->format_header && !order) {
len = strlen(section->format_header); len = strlen(section->format_header);
if (buf[len] == ':' && !strncmp(buf, section->format_header, len)) { if (!strncmp(buf, section->format_header, len) && buf[len] == ':') {
buf += len + 1; buf += len + 1;
while (!is_eol(*buf)) { while (!is_eol(*buf)) {
buf = skip_space(buf); buf = skip_space(buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment