summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-07-20 00:25:27 +0200
committerGrigori Goronzy <greg@blackbox>2009-07-20 00:25:27 +0200
commit2f74c6713dccee2b14b81a9c21731b83e181f31d (patch)
tree2079ef80973ec2644b6b2c2f538237416d25b63c
parent0ba4d4ceb16c1d3d678bcab63506ae6671b87889 (diff)
downloadlibass-2f74c6713dccee2b14b81a9c21731b83e181f31d.tar.bz2
libass-2f74c6713dccee2b14b81a9c21731b83e181f31d.tar.xz
Check for table availability when striking a glyph
The glyph striker (underline/strike-through) did not check for table availability, possibly accessing a NULL pointer. Change this to only strike the glyph if the table with the appropriate information is available. Currently there is no fallback for fonts without the required information.
-rw-r--r--libass/ass_font.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libass/ass_font.c b/libass/ass_font.c
index 8a93a4e..9518b70 100644
--- a/libass/ass_font.c
+++ b/libass/ass_font.c
@@ -316,7 +316,7 @@ static int ass_strike_outline_glyph(FT_Face face, ass_font_t *font,
y_scale = face->size->metrics.y_scale;
// Add points to the outline
- if (under) {
+ if (under && ps) {
int pos, size;
pos = FT_MulFix(ps->underlinePosition, y_scale * font->scale_y);
size = FT_MulFix(ps->underlineThickness,
@@ -339,7 +339,7 @@ static int ass_strike_outline_glyph(FT_Face face, ass_font_t *font,
ol->contours[ol->n_contours++] = ol->n_points - 1;
}
- if (through) {
+ if (through && os2) {
int pos, size;
pos = FT_MulFix(os2->yStrikeoutPosition, y_scale * font->scale_y);
size = FT_MulFix(os2->yStrikeoutSize, y_scale * font->scale_y / 2);