[FFmpeg-cvslog] avcodec/ass: check for av_mallocz() failure
Michael Niedermayer
git at videolan.org
Tue Dec 22 15:04:49 CET 2015
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Dec 22 14:41:27 2015 +0100| [05af8608c2dc8ed95e3afa3840308212f3df589e] | committer: Michael Niedermayer
avcodec/ass: check for av_mallocz() failure
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05af8608c2dc8ed95e3afa3840308212f3df589e
---
libavcodec/ass.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/ass.c b/libavcodec/ass.c
index 227d571..336c308 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)
More information about the ffmpeg-cvslog
mailing list