Aegisub/aegisub/libass
Amar Takhar c2267bedcc Plug a bunch of memory leaks from uau in the mplayer2 repo: http://repo.or.cz/w/mplayer.git?a=commit;h=312d9e4b104741b834aa5d71b02228d0cd988a4e
libass: Fix cache lookup problem causing memory bloat

The cache code did hash lookups by storing key values in struct fields
and then hashing and comparing the struct as a single memory block. In
at least one case such a struct contained uninitialized padding bytes
which prevented the complete memory area of the struct from matching
even though the fields did. As a result the code failed to find
existing objects in the cache and stored new versions of them, causing
gigabytes of memory use in some circumstances. Initializing the struct
memory to zero before writing the fields avoided such memory use in
tests but is not guaranteed to work if I interpret the C standard
correctly (the compiler is allowed to write garbage over padding bytes
when changing struct member values).

Change the code to use struct-specific hashing and comparison
functions that work field by field to guarantee correct behavior.
Create these by replacing the struct definition with a template that
lists the fields and can be used the generate each of struct
definition, hash function and compare function with some preprocessor
magic (otherwise every field would need to be listed separately in all
three).

Originally committed to SVN as r2895.
2009-05-04 06:48:21 +00:00
..
win32 SVN Transition Step 3/7 2009-03-08 08:30:39 +00:00
ass.c Update libass to r29169 of MPlayer. 2009-04-11 07:42:48 +00:00
ass.h SVN Transition Step 3/7 2009-03-08 08:30:39 +00:00
ass_bitmap.c Sync libass with r28935 from MPlayer. 2009-03-12 03:46:44 +00:00
ass_bitmap.h Sync libass with r28935 from MPlayer. 2009-03-12 03:46:44 +00:00
ass_cache.c Plug a bunch of memory leaks from uau in the mplayer2 repo: http://repo.or.cz/w/mplayer.git?a=commit;h=312d9e4b104741b834aa5d71b02228d0cd988a4e 2009-05-04 06:48:21 +00:00
ass_cache.h Plug a bunch of memory leaks from uau in the mplayer2 repo: http://repo.or.cz/w/mplayer.git?a=commit;h=312d9e4b104741b834aa5d71b02228d0cd988a4e 2009-05-04 06:48:21 +00:00
ass_cache_template.c Plug a bunch of memory leaks from uau in the mplayer2 repo: http://repo.or.cz/w/mplayer.git?a=commit;h=312d9e4b104741b834aa5d71b02228d0cd988a4e 2009-05-04 06:48:21 +00:00
ass_font.c Sync libass with r28935 from MPlayer. 2009-03-12 03:46:44 +00:00
ass_font.h Sync libass with r28935 from MPlayer. 2009-03-12 03:46:44 +00:00
ass_fontconfig.c Update libass to r29169 of MPlayer. 2009-04-11 07:42:48 +00:00
ass_fontconfig.h Sync libass with r28935 from MPlayer. 2009-03-12 03:46:44 +00:00
ass_library.c SVN Transition Step 3/7 2009-03-08 08:30:39 +00:00
ass_library.h SVN Transition Step 3/7 2009-03-08 08:30:39 +00:00
ass_render.c Plug a bunch of memory leaks from uau in the mplayer2 repo: http://repo.or.cz/w/mplayer.git?a=commit;h=312d9e4b104741b834aa5d71b02228d0cd988a4e 2009-05-04 06:48:21 +00:00
ass_types.h Sync libass with r28935 from MPlayer. 2009-03-12 03:46:44 +00:00
ass_utils.c Sync libass with r28935 from MPlayer. 2009-03-12 03:46:44 +00:00
ass_utils.h Sync libass with r28935 from MPlayer. 2009-03-12 03:46:44 +00:00
help_mp.h SVN Transition Step 3/7 2009-03-08 08:30:39 +00:00
libass.vcproj SVN Transition Step 3/7 2009-03-08 08:30:39 +00:00
libass_msvc.patch SVN Transition Step 3/7 2009-03-08 08:30:39 +00:00
Makefile.am Update the build system for the new repository layout. 2009-03-09 00:58:38 +00:00
mputils.c SVN Transition Step 3/7 2009-03-08 08:30:39 +00:00
mputils.h SVN Transition Step 3/7 2009-03-08 08:30:39 +00:00
msvc.h SVN Transition Step 3/7 2009-03-08 08:30:39 +00:00