From 4449ec9df99716a1be439c38bffe2a5b013c60bf Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Fri, 14 Aug 2009 13:57:02 +0200 Subject: Fix crash if glyph bitmap rasterization fails Check whether the glyph bitmap used for cache size calculations really exists. --- libass/ass_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.3