[poppler] Problem with your patch
Brad Hards
bradh at frogmouth.net
Thu Dec 20 02:09:09 PST 2007
On Thursday 20 December 2007 04:36:55 pm Koji Otani wrote:
> Hi
> I found 2 problems.
>
> (1) bad location of memory allocation code.
> and use null pointer.
> This causes crash.
>
> (2) But, getCodeToGIDMap function is called by the unexpected situation.
> In test PDF File (getticket.pdf), fonts are embedded and CIDToGIDMap
> entry is not contained. PDF specification sayes that if the TrueType font
> program is embedded, the Type 2 CIDFont dictionary must contain a
> CIDToGIDMap entry. (see PDF Reference, version 1.7 page 438).
> So, when a font is embedded, getCodeToGIDMap need not be called
> because cidToGID map is already set. but if CIDToGIDMap entry is
> 'identity' or not contained, getCodeToGIDMap is called and returnes
> incorrect cidToGID map.
>
> There has been problem(2) since poppler version 0.5.4 (before my
> patches were applied.)
>
> I attached patch resolves these problems.
>
> (1) moved the allocation code to correct location.
> (2) When a font is embedded, getCodeToGIDMap returnes cidToGID map
> is already set.
>
> This patch also removed unused variables.
>
> Please apply this patch.
Looks good to me, and stops my crashing.
Any objections? - if not, I'll apply it tomorrow morning (assuming no-one else
does before me).
Brad
More information about the poppler
mailing list