comparison libass/ass_render.c @ 23086:778394a078ba

Do not use FT_Glyph_Copy with NULL glyphs. Contrary to the docs, it leaves garbage in *target.
author eugeni
date Tue, 24 Apr 2007 17:36:03 +0000
parents 980da4e288f3
children 0574817cc6cb
comparison
equal deleted inserted replaced
23085:7defdf1c63ef 23086:778394a078ba
1237 info->glyph = info->outline_glyph = 0; 1237 info->glyph = info->outline_glyph = 0;
1238 1238
1239 val = cache_find_glyph(&key); 1239 val = cache_find_glyph(&key);
1240 if (val) { 1240 if (val) {
1241 FT_Glyph_Copy(val->glyph, &info->glyph); 1241 FT_Glyph_Copy(val->glyph, &info->glyph);
1242 FT_Glyph_Copy(val->outline_glyph, &info->outline_glyph); 1242 if (val->outline_glyph)
1243 FT_Glyph_Copy(val->outline_glyph, &info->outline_glyph);
1243 info->bbox = val->bbox_scaled; 1244 info->bbox = val->bbox_scaled;
1244 info->advance.x = val->advance.x; 1245 info->advance.x = val->advance.x;
1245 info->advance.y = val->advance.y; 1246 info->advance.y = val->advance.y;
1246 } else { 1247 } else {
1247 glyph_hash_val_t v; 1248 glyph_hash_val_t v;
1258 if (error) { 1259 if (error) {
1259 mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FT_Glyph_Stroke_Error, error); 1260 mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FT_Glyph_Stroke_Error, error);
1260 } 1261 }
1261 } 1262 }
1262 1263
1264 memset(&v, 0, sizeof(v));
1263 FT_Glyph_Copy(info->glyph, &v.glyph); 1265 FT_Glyph_Copy(info->glyph, &v.glyph);
1264 FT_Glyph_Copy(info->outline_glyph, &v.outline_glyph); 1266 if (info->outline_glyph)
1267 FT_Glyph_Copy(info->outline_glyph, &v.outline_glyph);
1265 v.advance = info->advance; 1268 v.advance = info->advance;
1266 v.bbox_scaled = info->bbox; 1269 v.bbox_scaled = info->bbox;
1267 cache_add_glyph(&key, &v); 1270 cache_add_glyph(&key, &v);
1268 } 1271 }
1269 } 1272 }