diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-12-22 16:41:27 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-12-22 16:41:27 +0300 |
commit | 05af8608c2dc8ed95e3afa3840308212f3df589e (patch) | |
tree | 84c13887f2d4fc053df64d91ddcdeee77296ec4a /libavcodec/ass.c | |
parent | 18cd7891cb10474e94f650e52e7d5196692b70c1 (diff) |
avcodec/ass: check for av_mallocz() failure
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/ass.c')
-rw-r--r-- | libavcodec/ass.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/ass.c b/libavcodec/ass.c index 227d571af1..336c3084e4 100644 --- a/libavcodec/ass.c +++ b/libavcodec/ass.c @@ -161,6 +161,8 @@ int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, sub->rects = rects; sub->end_display_time = FFMAX(sub->end_display_time, 10 * duration); rects[sub->num_rects] = av_mallocz(sizeof(*rects[0])); + if (!rects[sub->num_rects]) + goto errnomem; rects[sub->num_rects]->type = SUBTITLE_ASS; ret = av_bprint_finalize(&buf, &rects[sub->num_rects]->ass); if (ret < 0) |