Fix segfault when consuming zero-length caches in fc-cat (which has no
config, so FcConfigAddFontDir shouldn't be called.)
This commit is contained in:
parent
8a0b0ed6d0
commit
eadadf489a
|
@ -1,3 +1,9 @@
|
||||||
|
2006-01-14 Patirck Lam <plam@mit.edu>
|
||||||
|
* src/fccache.c (FcDirCacheConsume):
|
||||||
|
|
||||||
|
Fix segfault when consuming zero-length caches in fc-cat
|
||||||
|
(which has no config, so FcConfigAddFontDir shouldn't be called.)
|
||||||
|
|
||||||
2006-01-14 Patrick Lam <plam@mit.edu>
|
2006-01-14 Patrick Lam <plam@mit.edu>
|
||||||
* fc-cache/fc-cache.c (scanDirs):
|
* fc-cache/fc-cache.c (scanDirs):
|
||||||
* fontconfig/fontconfig.h:
|
* fontconfig/fontconfig.h:
|
||||||
|
|
|
@ -978,7 +978,8 @@ FcDirCacheConsume (int fd, const char * dir, FcFontSet *set, FcConfig *config)
|
||||||
{
|
{
|
||||||
pos = FcCacheNextOffset (lseek(fd, 0, SEEK_CUR));
|
pos = FcCacheNextOffset (lseek(fd, 0, SEEK_CUR));
|
||||||
lseek (fd, pos, SEEK_SET);
|
lseek (fd, pos, SEEK_SET);
|
||||||
FcConfigAddFontDir (config, (FcChar8 *)dir);
|
if (config)
|
||||||
|
FcConfigAddFontDir (config, (FcChar8 *)dir);
|
||||||
return FcTrue;
|
return FcTrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue