]> granicus.if.org Git - libass/commitdiff
Fix crash because of last_glyph < first_glyph, probably caused by first line
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sun, 15 Oct 2006 13:03:43 +0000 (13:03 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sun, 15 Oct 2006 13:03:43 +0000 (13:03 +0000)
only consisting of '\n'

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20232 b3059339-0415-0410-9bf9-f77b7e298cf2

libass/ass_render.c

index abb27220511617ebcb9067fb382bac648fcba28e..ba0764d5178949f83a46cc813e42911d36bf0220 100644 (file)
@@ -1724,7 +1724,7 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images)
                                glyph_info_t* first_glyph = text_info.glyphs + last_break + 1;
                                glyph_info_t* last_glyph = text_info.glyphs + i - 1;
 
-                               while ((last_glyph >= first_glyph) && ((last_glyph->symbol == '\n') || (last_glyph->symbol == 0)))
+                               while ((last_glyph > first_glyph) && ((last_glyph->symbol == '\n') || (last_glyph->symbol == 0)))
                                        last_glyph --;
 
                                width = last_glyph->pos.x + last_glyph->bbox.xMax - first_glyph->pos.x - first_glyph->bbox.xMin;