Bug 34787

Summary: [PATCH] stop ddf.EscherClientAnchorRecord breaking on short records
Product: POI Reporter: Nick Burch <apache>
Component: POIFSAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: patch for short records
Updated patch that also handles the size when writing back out
Patch to the unit test for EscherClientAnchorRecord

Description Nick Burch 2005-05-06 18:09:08 UTC
ddf.EscherClientAnchorRecord assumes that it has 9 2 byte records, and hence is
26 bytes long. In some powerpoint files, it just has 4 2 bytes records, so the
size is only 16 bytes. Because of its assumption, this breaks things.

Attached is a patch to make it check that it has the data before trying to read
the last 5 fields, which stops it breaking on 4 field records. (However, it
makes no attempt to ensure that the first 4 fields correspond to the ones
present in a short record, since there's no guide I can find to explain what the
4 fields in a short record actually correspond to)
Comment 1 Nick Burch 2005-05-06 18:09:28 UTC
Created attachment 14954 [details]
patch for short records
Comment 2 Nick Burch 2005-05-06 18:36:21 UTC
Created attachment 14955 [details]
Updated patch that also handles the size when writing back out

Forgot to store the fact that we are a short record for when writing back out.
This version uses that when writing out, and disables short record status if
any of flags 5-9 happen to get set
Comment 3 Avik Sengupta 2005-05-25 17:38:08 UTC
Comitted, thanks. pls verify. 
Comment 4 Nick Burch 2005-05-25 23:23:52 UTC
Created attachment 15172 [details]
Patch to the unit test for EscherClientAnchorRecord

Update to the unit test, to include a test for short records

(Shows that the currently applied patch works just great)