summaryrefslogtreecommitdiffstats
path: root/libavcodec/ass_split.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-11-17 17:45:03 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-11-17 18:05:18 +0100
commitae514b1254318ae5e76be2c17055f14b4084ccf0 (patch)
tree0e820fb8019e9742dac2a791481cbe76489303f5 /libavcodec/ass_split.c
parent1398ded7a77b2057a3e9983e3df512855b7ff0eb (diff)
downloadffmpeg-streaming-ae514b1254318ae5e76be2c17055f14b4084ccf0.zip
ffmpeg-streaming-ae514b1254318ae5e76be2c17055f14b4084ccf0.tar.gz
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: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/ass_split.c')
-rw-r--r--libavcodec/ass_split.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c
index d3e8a8d..872528b 100644
--- a/libavcodec/ass_split.c
+++ b/libavcodec/ass_split.c
@@ -275,7 +275,7 @@ static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
}
if (section->format_header && !order) {
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;
while (!is_eol(*buf)) {
buf = skip_space(buf);
OpenPOWER on IntegriCloud