diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-06-19 19:26:36 +0300 |
---|---|---|
committer | greg <greg@blackbox> | 2009-06-20 15:35:29 +0200 |
commit | 0b9223d493e016ccdce91aae1a6f69aff6c03a0f (patch) | |
tree | c1746049bf4173693b1cab28693a21bd6abaf394 /libass/ass_cache.h | |
parent | 6a5c6a3748e3825d7a4281cfeac4ca25b32c8571 (diff) | |
download | libass-0b9223d493e016ccdce91aae1a6f69aff6c03a0f.tar.bz2 libass-0b9223d493e016ccdce91aae1a6f69aff6c03a0f.tar.xz |
Use safe hash functions for composite bitmaps
Previously the composite bitmap hash keys were compared and hashed
based on all the bytes in the struct, which could cause problems
because of padding bytes. Change the code to use field-by-field
operations as already done for other hash key types.
The composite hash key contains two bitmap hash keys. The hashing
function currently handles those by calling the function to calculate
the corresponding bitmap hash, and then updating the composite hash by
treating the result of the function call as a byte buffer. An
alternative would be to change the hash functions so that the initial
hash value could be passed as a parameter to the recursively called
function.
Diffstat (limited to 'libass/ass_cache.h')
-rw-r--r-- | libass/ass_cache.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/libass/ass_cache.h b/libass/ass_cache.h index f374b86..c1d25b2 100644 --- a/libass/ass_cache.h +++ b/libass/ass_cache.h @@ -83,14 +83,6 @@ hashmap_t *ass_bitmap_cache_reset(hashmap_t *bitmap_cache); void ass_bitmap_cache_done(hashmap_t *bitmap_cache); -// Cache for composited bitmaps -typedef struct composite_hash_key_s { - int aw, ah, bw, bh; - int ax, ay, bx, by; - bitmap_hash_key_t a; - bitmap_hash_key_t b; -} composite_hash_key_t; - typedef struct composite_hash_val_s { unsigned char *a; unsigned char *b; |