From: Grigori Goronzy Date: Mon, 7 Sep 2015 23:38:44 +0000 (+0200) Subject: fontselect: handle additional malloc errors X-Git-Tag: 0.13.0~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d57c52f2cc62fc31588eb3f9c5fbedd5e4de674;p=libass fontselect: handle additional malloc errors --- diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c index 2a00c37..7c02373 100644 --- a/libass/ass_fontselect.c +++ b/libass/ass_fontselect.c @@ -1051,9 +1051,12 @@ void ass_map_font(const ASS_FontMapping *map, int len, const char *name, { for (int i = 0; i < len; i++) { if (strcasecmp(map[i].from, name) == 0) { - meta->n_fullname = 1; meta->fullnames = calloc(1, sizeof(char *)); - meta->fullnames[0] = strdup(map[i].to); + if (meta->fullnames) { + meta->fullnames[0] = strdup(map[i].to); + if (meta->fullnames[0]) + meta->n_fullname = 1; + } return; } }