mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 14:38:13 +02:00
[cairo-ft-font] Early detection of a zero sized bitmap.
Under rare circumstances we may need to extract a surface that
represents a bitmap with width==0 and rows==0. Detect this case at the
start and simply return a zero-sized surface.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=12284.
(cherry picked from commit d62f886168)
This commit is contained in:
parent
9b0a093547
commit
7092924195
1 changed files with 6 additions and 0 deletions
|
|
@ -736,6 +736,12 @@ _get_bitmap_surface (FT_Bitmap *bitmap,
|
|||
width = bitmap->width;
|
||||
height = bitmap->rows;
|
||||
|
||||
if (width == 0 || height == 0) {
|
||||
*surface = (cairo_image_surface_t *)
|
||||
cairo_image_surface_create_for_data (NULL, format, 0, 0, 0);
|
||||
return (*surface)->base.status;
|
||||
}
|
||||
|
||||
switch (bitmap->pixel_mode) {
|
||||
case FT_PIXEL_MODE_MONO:
|
||||
stride = (((width + 31) & ~31) >> 3);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue