Details
-
Sub-task
-
Resolution: Fixed
-
Medium
-
None
-
6.02/12, 5.34/32
-
None
-
Fedora 22 and others
Description
There are two problem with the code. Looking at a hexdump of a Type 1 font:
00000000 80 01 fb 15 00 00 25 21 50 53 2d 41 64 6f 62 65 |......%!PS-Adobe|
00000010 46 6f 6e 74 2d 31 2e 30 3a 20 53 74 61 6e 64 61 |Font-1.0: Standa|
[ ... ]
00008390 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0d 63 |00000000000000.c|
000083a0 6c 65 61 72 74 6f 6d 61 72 6b 0a 80 03 |leartomark...|
The code currently reads beyond the 80 03 at the end of the file by trying to determing the length of the following block - but an end of file block does not have a length, the file ends right after the end of file block tag 08 03.
The length is in little endian format - as can be seen in the beginning of the file. The ascii block tag 80 01 is followed by fb 15 00 00 which is little endian for 000015fb. So it is big endian architectures that needs to do a byte swap, not little endian ones as in the current code.
The first attached patch addresses these issues. The second patch implements returning the fontname for Type 1 embedding.