Bug 34787 - [PATCH] stop ddf.EscherClientAnchorRecord breaking on short records
Summary: [PATCH] stop ddf.EscherClientAnchorRecord breaking on short records
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POIFS (show other bugs)
Version: 3.0-dev
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-06 18:09 UTC by Nick Burch
Modified: 2005-05-25 15:23 UTC (History)
0 users



Attachments
patch for short records (1.71 KB, patch)
2005-05-06 18:09 UTC, Nick Burch
Details | Diff
Updated patch that also handles the size when writing back out (4.86 KB, patch)
2005-05-06 18:36 UTC, Nick Burch
Details | Diff
Patch to the unit test for EscherClientAnchorRecord (1.65 KB, patch)
2005-05-25 23:23 UTC, Nick Burch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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)