From d9f0a7b4ade7af7cc7fff9573b7a6025d11bfd7f Mon Sep 17 00:00:00 2001 From: eugeni Date: Sun, 3 Sep 2006 17:25:04 +0000 Subject: More checks in ass_render_event. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19656 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'libass/ass_render.c') diff --git a/libass/ass_render.c b/libass/ass_render.c index c0b30858de..aba49ec3ad 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1514,6 +1514,15 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) int alignment, halign, valign; int device_x = 0, device_y = 0; + if (!event->Style) { + mp_msg(MSGT_GLOBAL, MSGL_WARN, "No style found!\n"); + return 1; + } + if (!event->Text) { + mp_msg(MSGT_GLOBAL, MSGL_WARN, "Empty event!\n"); + return 1; + } + init_render_context(event); text_info.length = 0; @@ -1521,14 +1530,7 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) pen.y = 0; previous = 0; num_glyphs = 0; - - p = event->Text; - if (!p) { - mp_msg(MSGT_GLOBAL, MSGL_WARN, "Empty event!\n"); - return 1; - } - // Event parsing. while (1) { render_context.effect_type = EF_NONE; -- cgit v1.2.3