Bug 691311

Summary: Valgrind warning caused by FAPI changes.
Product: Ghostscript Reporter: Alex Cherepanov <alex>
Component: Font APIAssignee: Chris Liddell (chrisl) <chris.liddell>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: master   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: patch

Description Alex Cherepanov 2010-05-17 02:38:55 UTC
Valgrind reports the following warning for 
valgrind gs -sDEVICE=nullpage -o /dev/null comparefiles/Bug689509.pdf

 Conditional jump or move depends on uninitialised value(s)
    at 0x4D8687: array_get (iutil.c:652)
    by 0x4FD1FC: op_show_continue_dispatch (zchar.c:626)
    by 0x4FCC2A: op_show_continue_pop (zchar.c:530)
    by 0x4FB4B7: zshow (zchar.c:65)
    by 0x4C97F1: call_operator (interp.c:94)
    by 0x4CD2BE: interp (interp.c:1526)
    by 0x4C9EA4: gs_call_interp (interp.c:484)
    by 0x4C9CDE: gs_interpret (interp.c:442)
    by 0x4BD724: gs_main_interpret (imain.c:240)
    by 0x4BE27B: gs_main_run_string_end (imain.c:556)
    by 0x4BE138: gs_main_run_string_with_length (imain.c:514)
    by 0x4BE0A5: gs_main_run_string (imain.c:496)

The problem is caused by FAPI changes that give /BuildChar procedure
to all fonts including CIDFont resources. So the check for
non-null pfdata->BuildChar no longer guaranteed that the font has /Encoding.
Perhaps, we can just check for non-null pfdata->Encoding .
Comment 1 Ken Sharp 2010-05-17 06:59:04 UTC
re-assigning to Chris.
Comment 2 Alex Cherepanov 2010-06-05 22:45:02 UTC
Created attachment 6353 [details]
patch

Check whether the font has /Encoding before trying to use it.
Comment 3 Alex Cherepanov 2010-06-08 01:06:14 UTC
I've committed the patch as a rev. 11361.
Better solutions are always welcome.