]> granicus.if.org Git - libass/commitdiff
Fix underrun in slant pen correction
authorGrigori Goronzy <greg@blackbox>
Tue, 1 Sep 2009 11:31:04 +0000 (13:31 +0200)
committerGrigori Goronzy <greg@blackbox>
Tue, 1 Sep 2009 21:20:57 +0000 (23:20 +0200)
libass/ass_render.c

index fe5114acb93fa363c4ec0c70ba1e62486a4d0a81..de7f045ccfcc79928e100c46efeab45ce1a3f7e5 100644 (file)
@@ -2745,7 +2745,8 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event,
             !render_priv->state.italic) {
             int back = text_info->length - 1;
             GlyphInfo *og = &text_info->glyphs[back];
-            while (og->bbox.xMax - og->bbox.xMin == 0 && og->hash_key.italic)
+            while (back && og->bbox.xMax - og->bbox.xMin == 0
+                   && og->hash_key.italic)
                 og = &text_info->glyphs[--back];
             if (og->bbox.xMax > og->advance.x) {
                 // The FreeType oblique slants by 6/16