summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-28 19:21:34 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-28 19:21:34 +0000
commit86509673b95b92add4d03d9aae57844b46b07877 (patch)
treeeb2232d0d30fac1fcaf8f823a26a6c35e3b21510
parent9f712dcf64a837b61dac21c8fd13a9fb5e40e754 (diff)
downloadlibass-86509673b95b92add4d03d9aae57844b46b07877.tar.bz2
libass-86509673b95b92add4d03d9aae57844b46b07877.tar.xz
Initialize all structs to 0 before using them.
This is consistent with the remaining code (which uses e.g. calloc) and makes it easier to extend the structs in the future. As a side effect it fixes several valgrind errors in hashmap_hash/hashmap_key_compare caused by padding in the structures, but it is not a correct fix for that issue. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29086 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libass/ass_render.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index b561b2a..d06fffb 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -455,6 +455,7 @@ static void render_overlap(ass_image_t** last_tail, ass_image_t** tail, bitmap_h
cur_top = top-by;
// Query cache
+ memset(&hk, 0, sizeof(hk));
memcpy(&hk.a, last_hash, sizeof(*last_hash));
memcpy(&hk.b, hash, sizeof(*hash));
hk.aw = aw;
@@ -1429,6 +1430,7 @@ static void get_outline_glyph(int symbol, glyph_info_t* info, FT_Vector* advance
int error;
glyph_hash_val_t* val;
glyph_hash_key_t key;
+ memset(&key, 0, sizeof(key));
key.font = render_context.font;
key.size = render_context.font_size;
key.ch = symbol;
@@ -2166,6 +2168,7 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images)
for (i = 0; i < text_info.length; ++i)
get_bitmap_glyph(text_info.glyphs + i);
+ memset(event_images, 0, sizeof(*event_images));
event_images->top = device_y - d6_to_int(text_info.lines[0].asc);
event_images->height = d6_to_int(text_info.height);
event_images->detect_collisions = render_context.detect_collisions;