Bug 703798

Summary: OCMD Parsing Error
Product: MuPDF Reporter: Jorj <jorj.x.mckie>
Component: mupdfAssignee: MuPDF bugs <mupdf-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: 1.18.0   
Hardware: PC   
OS: Windows 10   
Customer: Word Size: ---
Attachments: line will be ignored by MuPDF viewer and mutool draw

Description Jorj 2021-04-22 11:47:59 UTC
Created attachment 20940 [details]
line will be ignored by MuPDF viewer and mutool draw

If the /OCGs key of an /OCMD object is a dictionary, and not an array, then the wrong OCMD state may be computed.
The attached example contains 1 OCG an 1 OCMD referencing the OCG as a dictionary.
The first textline is subject to the OCMD's visibility state.
Result:
The viewer MuPDF will not show that textline, and its text will neither be extracted via mutool draw.

If however changing the OCMD reference of the OCG to a (one-element) array, expected behaviour occurs.

According to PDF spec, the /OCGs key in OCMD objects may be either: an array or a dictionary.