[winfonts] Avoid zero bitmap width and height.
Reported as https://bugzilla.mozilla.org/show_bug.cgi?id=1272173 * src/winfonts/winfnt.c (FNT_Face_Init): Check zero pixel height. (FNT_Load_Glyph): Check for zero pitch.
This commit is contained in:
parent
125f2b63a5
commit
248f5629d8
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2016-08-13 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
[winfonts] Avoid zero bitmap width and height.
|
||||||
|
|
||||||
|
Reported as
|
||||||
|
|
||||||
|
https://bugzilla.mozilla.org/show_bug.cgi?id=1272173
|
||||||
|
|
||||||
|
* src/winfonts/winfnt.c (FNT_Face_Init): Check zero pixel height.
|
||||||
|
(FNT_Load_Glyph): Check for zero pitch.
|
||||||
|
|
||||||
2016-08-11 Alexei Podtelezhnikov <apodtele@gmail.com>
|
2016-08-11 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||||
|
|
||||||
* src/truetype/ttinterp.c (Pop_Push_Count): Revert changes.
|
* src/truetype/ttinterp.c (Pop_Push_Count): Revert changes.
|
||||||
|
|
|
@ -759,6 +759,14 @@
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
|
/* sanity check */
|
||||||
|
if ( !face->font->header.pixel_height )
|
||||||
|
{
|
||||||
|
FT_TRACE2(( "invalid pixel height\n" ));
|
||||||
|
error = FT_THROW( Invalid_File_Format );
|
||||||
|
goto Fail;
|
||||||
|
}
|
||||||
|
|
||||||
/* we now need to fill the root FT_Face fields */
|
/* we now need to fill the root FT_Face fields */
|
||||||
/* with relevant information */
|
/* with relevant information */
|
||||||
{
|
{
|
||||||
|
@ -1062,7 +1070,8 @@
|
||||||
bitmap->rows = font->header.pixel_height;
|
bitmap->rows = font->header.pixel_height;
|
||||||
bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
|
bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
|
||||||
|
|
||||||
if ( offset + pitch * bitmap->rows > font->header.file_size )
|
if ( !pitch ||
|
||||||
|
offset + pitch * bitmap->rows > font->header.file_size )
|
||||||
{
|
{
|
||||||
FT_TRACE2(( "invalid bitmap width\n" ));
|
FT_TRACE2(( "invalid bitmap width\n" ));
|
||||||
error = FT_THROW( Invalid_File_Format );
|
error = FT_THROW( Invalid_File_Format );
|
||||||
|
|
Loading…
Reference in New Issue