diff options
author | Kjartan Maraas <kmaraas@gnome.org> | 2006-07-13 10:28:30 -0400 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2006-07-13 10:28:30 -0400 |
commit | 8fc012344f8f072ee3bd1b09c336fed8d47826c5 (patch) | |
tree | 2678e634c5bd30ad35e07a4d0bfd99aedfabbb90 | |
parent | 824f87ba102e36808c59e92d7f527ca2f8b00026 (diff) | |
download | xorg-lib-libXft-8fc012344f8f072ee3bd1b09c336fed8d47826c5.tar.gz |
Bug #7259: Various Coverity fixes.
-rw-r--r-- | src/xftcore.c | 2 | ||||
-rw-r--r-- | src/xftdraw.c | 2 | ||||
-rw-r--r-- | src/xftrender.c | 2 | ||||
-rw-r--r-- | src/xftxlfd.c | 4 |
4 files changed, 6 insertions, 4 deletions
diff --git a/src/xftcore.c b/src/xftcore.c index 92e4e25..083a133 100644 --- a/src/xftcore.c +++ b/src/xftcore.c @@ -921,7 +921,7 @@ _XftGlyphDefault (Display *dpy, XftFont *public) if (XftFontCheckGlyph (dpy, public, FcTrue, 0, missing, &nmissing)) glyphs_loaded = FcTrue; if (nmissing) - XftFontLoadGlyphs (dpy, public, FcTrue, missing, nmissing); + XftFontLoadGlyphs (dpy, public, glyphs_loaded, missing, nmissing); return font->glyphs[0]; } diff --git a/src/xftdraw.c b/src/xftdraw.c index 1a1db52..1e8b6de 100644 --- a/src/xftdraw.c +++ b/src/xftdraw.c @@ -210,7 +210,7 @@ _XftDrawFormat (XftDraw *draw) { XftDisplayInfo *info = _XftDisplayInfoGet (draw->dpy, True); - if (!info->hasRender) + if (!info || !info->hasRender) return 0; if (draw->visual == 0) diff --git a/src/xftrender.c b/src/xftrender.c index 9e8c1eb..1562e62 100644 --- a/src/xftrender.c +++ b/src/xftrender.c @@ -518,7 +518,7 @@ XftGlyphFontSpecRender (Display *dpy, break; } } - if (i == nglyphs) + if (i == nglyphs || !firstFont) goto bail2; glyph = firstFont->glyphs[g]; format = firstFont->format; diff --git a/src/xftxlfd.c b/src/xftxlfd.c index df48694..4137e52 100644 --- a/src/xftxlfd.c +++ b/src/xftxlfd.c @@ -128,8 +128,10 @@ XftXlfdParse (const char *xlfd_orig, FcBool ignore_scalable, FcBool complete) save = (char *) malloc (strlen (foundry) + 1); - if (!save) + if (!save) { + FcPatternDestroy (pat); return 0; + } if (!FcPatternAddString (pat, XFT_XLFD, (FcChar8 *) xlfd_orig)) goto bail; |