diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-01 14:24:10 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-04-02 19:07:59 +0200 |
commit | f38f791a23a8acade7ea6554c80455dce7543dbd (patch) | |
tree | b516178b57e6e7cbc4b339fe565d396b5b4f7335 | |
parent | 0062aca592868e9fd7b6fcb322747d42d71e7315 (diff) | |
download | ffmpeg-f38f791a23a8acade7ea6554c80455dce7543dbd.tar.gz |
avcodec/ass_split: Don't presume strlen to be >= 2
Fixes potential heap-buffer-overflow.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r-- | libavcodec/ass_split.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c index c2c388d9f0..189272bbd9 100644 --- a/libavcodec/ass_split.c +++ b/libavcodec/ass_split.c @@ -376,7 +376,7 @@ ASSSplitContext *ff_ass_split(const char *buf) ASSSplitContext *ctx = av_mallocz(sizeof(*ctx)); if (!ctx) return NULL; - if (buf && !memcmp(buf, "\xef\xbb\xbf", 3)) // Skip UTF-8 BOM header + if (buf && !strncmp(buf, "\xef\xbb\xbf", 3)) // Skip UTF-8 BOM header buf += 3; ctx->current_section = -1; if (ass_split(ctx, buf) < 0) { |