[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] regression from fix eca0f067 to Savannah bug #43679
From: |
Hin-Tak Leung |
Subject: |
[ft-devel] regression from fix eca0f067 to Savannah bug #43679 |
Date: |
Thu, 27 Oct 2016 01:03:03 +0000 (UTC) |
Hi Werner,
I just noticed two of my old stash of CJK fonts stopped working (they used to
and I have a pdf sample sheet to proof that...).
I hunted it down to:
commit eca0f067068020870a429fe91f6329e499390d55
Author: Werner Lemberg <address@hidden>
Date: Mon Nov 24 10:22:08 2014 +0100
[truetype] Fix Savannah bug #43679.
The problem is the change below - the two fonts have "num_records = 0' and
'record_size =0'.
I think if 'num_records = 0' any record_size should be valid :-).
Does this code assumes truetype fonts must have at least two glyphs (thus
record_size is minimum 4)?
and which two - notdef and nbsp ?
Anyway, record_size zero (or any value) is valid if 'num_records = 0'...
nothing to read, anything is valid.
Hin-Tak
====
@@ -522,8 +522,10 @@
record_size &= 0xFFFFU;
/* The limit for `num_records' is a heuristic value. */
-
- if ( version != 0 || num_records > 255 || record_size > 0x10001L )
+ if ( version != 0 ||
+ num_records > 255 ||
+ record_size > 0x10001L ||
+ record_size < 4 )
{
error = FT_THROW( Invalid_File_Format );
goto Fail;
====
- [ft-devel] regression from fix eca0f067 to Savannah bug #43679,
Hin-Tak Leung <=