[ 
https://issues.apache.org/jira/browse/PDFBOX-442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Lehmkühler resolved PDFBOX-442.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.8.0-incubator

The second get on the map isn't needed. If we have the value, than we don't 
have to get it twice. Furthermore the cmapObjects is a synchronized map so that 
all accesses to that class-member shouldn't  be critical even in a multithreded 
environment.
I've delete the unneeded second get on the map with version 773370.

> race condition in PdfFont
> -------------------------
>
>                 Key: PDFBOX-442
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-442
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 0.7.3
>            Reporter: Sean Bridges
>             Fix For: 0.8.0-incubator
>
>
> this code in PDFFont.encode isn't thread safe,
>                         COSName encodingName = (COSName)encoding;
>                         cmap = (CMap)cmapObjects.get( encodingName );
>                         if( cmap != null )
>                         {
>                             cmap = (CMap)cmapObjects.get( encodingName );
>                         }
> cmap may be cleared in PDFont.clearResources(), and it may be cleared in the 
> interval between the two get() calls.  The first get() may be non null, while 
> the second may be null.  The second get may be removed altogether.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to