]> granicus.if.org Git - libass/commitdiff
More checks in ass_render_event.
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sun, 3 Sep 2006 17:25:04 +0000 (17:25 +0000)
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sun, 3 Sep 2006 17:25:04 +0000 (17:25 +0000)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19656 b3059339-0415-0410-9bf9-f77b7e298cf2

libass/ass_render.c

index c0b30858de275875b117ec304a4fcb4e44ed3526..aba49ec3ad50dd8f73daa2d40c2ea72b255f94ec 100644 (file)
@@ -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;