summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-08-14 13:57:02 +0200
committerGrigori Goronzy <greg@blackbox>2009-08-14 13:57:02 +0200
commit4449ec9df99716a1be439c38bffe2a5b013c60bf (patch)
tree4bcb18db1bafbf672b8751fdafd766ebe99bc5bc
parenta70c851e75871cef06f039755ba49939a85e7ece (diff)
downloadlibass-4449ec9df99716a1be439c38bffe2a5b013c60bf.tar.bz2
libass-4449ec9df99716a1be439c38bffe2a5b013c60bf.tar.xz
Fix crash if glyph bitmap rasterization fails
Check whether the glyph bitmap used for cache size calculations really exists.
-rw-r--r--libass/ass_cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libass/ass_cache.c b/libass/ass_cache.c
index ac0a00f..643d991 100644
--- a/libass/ass_cache.c
+++ b/libass/ass_cache.c
@@ -226,7 +226,7 @@ void *cache_add_bitmap(Hashmap *bitmap_cache, BitmapHashKey *key,
// Note: this is only an approximation
if (val->bm_o)
bitmap_cache->cache_size += val->bm_o->w * val->bm_o->h * 3;
- else
+ else if (val->bm)
bitmap_cache->cache_size += val->bm->w * val->bm->h * 3;
return hashmap_insert(bitmap_cache, key, val);