mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-19 09:02:26 +02:00
avcodec/ass_split: Don't presume strlen to be >= 2
Fixes potential heap-buffer-overflow. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
0062aca592
commit
f38f791a23
@ -376,7 +376,7 @@ ASSSplitContext *ff_ass_split(const char *buf)
|
|||||||
ASSSplitContext *ctx = av_mallocz(sizeof(*ctx));
|
ASSSplitContext *ctx = av_mallocz(sizeof(*ctx));
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
return NULL;
|
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;
|
buf += 3;
|
||||||
ctx->current_section = -1;
|
ctx->current_section = -1;
|
||||||
if (ass_split(ctx, buf) < 0) {
|
if (ass_split(ctx, buf) < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user