summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr.Smile <vabnick@gmail.com>2014-03-04 02:24:34 +0400
committerwm4 <wm4@nowhere>2014-03-07 12:20:41 +0100
commit98707694069b6f1808eef5e1d23bc63fb575e067 (patch)
tree1470d98b553086e1ea0fced15c58832e26717063
parent9416f2550d7b0ae16756771b550accccf85eb256 (diff)
downloadlibass-98707694069b6f1808eef5e1d23bc63fb575e067.tar.bz2
libass-98707694069b6f1808eef5e1d23bc63fb575e067.tar.xz
Better fix for zero area outlines
Signed-off-by: wm4 <wm4@nowhere> Commit 04b51c2d broke BorderStyle=3 with text that had spaces.
-rw-r--r--libass/ass_bitmap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c
index 98c8d74..f214651 100644
--- a/libass/ass_bitmap.c
+++ b/libass/ass_bitmap.c
@@ -166,8 +166,14 @@ Bitmap *outline_to_bitmap(ASS_Library *library, FT_Library ftlib,
FT_Bitmap bitmap;
FT_Outline_Get_CBox(outline, &bbox);
- if (bbox.xMin == bbox.xMax || bbox.yMin == bbox.yMax)
- return NULL;
+ if (bbox.xMin >= bbox.xMax || bbox.yMin >= bbox.yMax) {
+ Bitmap *bm = malloc(sizeof(Bitmap));
+ bm->buffer = NULL;
+ bm->w = bm->h = 0;
+ bm->stride = 0;
+ bm->left = bm->top = 0;
+ return bm;
+ }
// move glyph to origin (0, 0)
bbox.xMin &= ~63;