mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-17 12:30:11 +01:00
avcodec/ass: check for av_mallocz() failure
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -161,6 +161,8 @@ int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,
|
|||||||
sub->rects = rects;
|
sub->rects = rects;
|
||||||
sub->end_display_time = FFMAX(sub->end_display_time, 10 * duration);
|
sub->end_display_time = FFMAX(sub->end_display_time, 10 * duration);
|
||||||
rects[sub->num_rects] = av_mallocz(sizeof(*rects[0]));
|
rects[sub->num_rects] = av_mallocz(sizeof(*rects[0]));
|
||||||
|
if (!rects[sub->num_rects])
|
||||||
|
goto errnomem;
|
||||||
rects[sub->num_rects]->type = SUBTITLE_ASS;
|
rects[sub->num_rects]->type = SUBTITLE_ASS;
|
||||||
ret = av_bprint_finalize(&buf, &rects[sub->num_rects]->ass);
|
ret = av_bprint_finalize(&buf, &rects[sub->num_rects]->ass);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user