Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-01 16:24:10 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-02 20:07:59 +0300
commitf38f791a23a8acade7ea6554c80455dce7543dbd (patch)
treeb516178b57e6e7cbc4b339fe565d396b5b4f7335 /libavcodec/ass_split.c
parent0062aca592868e9fd7b6fcb322747d42d71e7315 (diff)
avcodec/ass_split: Don't presume strlen to be >= 2
Fixes potential heap-buffer-overflow. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
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 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) {