diff options
author | wm4 <wm4@nowhere> | 2014-11-20 22:07:02 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-20 22:07:02 +0100 |
commit | 4881a6e11764ee5c4b755d45738c243042111b6c (patch) | |
tree | 4bd4ea1ce0aa2c3d9324d6b547fd0b28217be9cc /libass/ass_fontconfig.c | |
parent | 9f2d07b8038e9637be331e84c16dea4c0ec5cd76 (diff) | |
download | libass-4881a6e11764ee5c4b755d45738c243042111b6c.tar.bz2 libass-4881a6e11764ee5c4b755d45738c243042111b6c.tar.xz |
More malloc checking
Don't crash if running out of memory when allocating per-glyph data
during shaping. Also some fixes to initialization.
The caller of ass_fontconfig.c/match_fullname() actually handles a NULL
return value correctly.
Diffstat (limited to 'libass/ass_fontconfig.c')
-rw-r--r-- | libass/ass_fontconfig.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c index c44e4dec..f0e9000e 100644 --- a/libass/ass_fontconfig.c +++ b/libass/ass_fontconfig.c @@ -70,6 +70,9 @@ match_fullname(ASS_Library *lib, FCInstance *priv, const char *family, int nsets = 0; int i, fi; + if (!result) + return NULL; + if ((sets[nsets] = FcConfigGetFonts(priv->config, FcSetSystem))) nsets++; if ((sets[nsets] = FcConfigGetFonts(priv->config, FcSetApplication))) |