diff options
author | Grigori Goronzy <greg@blackbox> | 2009-07-30 01:04:29 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2009-07-30 01:05:19 +0200 |
commit | 78c8cdd38641a75b6bd8667d3229659a2db319b1 (patch) | |
tree | bc3ba6ffe58201436443eebcf24ae2fcdcdfbfe0 | |
parent | a097bc2d84242370b15257d602af221430da8825 (diff) | |
download | libass-78c8cdd38641a75b6bd8667d3229659a2db319b1.tar.bz2 libass-78c8cdd38641a75b6bd8667d3229659a2db319b1.tar.xz |
Get rid of MAX_EVENTS limit
Allocate the maximum possible number of used events in fix_collisions
dynamically, eliminating the MAX_EVENTS limit.
-rw-r--r-- | libass/ass_render.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c index 440099f..8c249e0 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -3334,8 +3334,6 @@ static int cmp_event_layer(const void *p1, const void *p2) return 0; } -#define MAX_EVENTS 100 - static render_priv_t *get_render_priv(ass_renderer_t *render_priv, ass_event_t *event) { @@ -3421,7 +3419,7 @@ static int fit_segment(segment_t *s, segment_t *fixed, int *cnt, int dir) static void fix_collisions(ass_renderer_t *render_priv, event_images_t *imgs, int cnt) { - segment_t used[MAX_EVENTS]; + segment_t *used = malloc(cnt * sizeof(*used)); int cnt_used = 0; int i, j; @@ -3477,6 +3475,8 @@ fix_collisions(ass_renderer_t *render_priv, event_images_t *imgs, int cnt) } } + + free(used); } /** |