Browse Source

avcodec/ass_split: Don't presume strlen to be >= 2

Fixes potential heap-buffer-overflow.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
master
Andreas Rheinhardt Andreas Rheinhardt 4 years ago
parent
commit
f38f791a23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/ass_split.c

+ 1
- 1
libavcodec/ass_split.c View File

@@ -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) {


Loading…
Cancel
Save