https://issues.apache.org/bugzilla/show_bug.cgi?id=46391





--- Comment #6 from Yegor Kozlov <[email protected]>  2009-02-17 01:11:35 PST ---
There is a unsupported chain terminator (entry = -3) right after the block with
index=11024. It can be seen if you put a debug statement in
BlockAllocationTableReader.setEntries at line 292:

                if (entry == POIFSConstants.UNUSED_BLOCK)
                {
                    raw_blocks.zap(_entries.size());
                }
                System.out.println(offset + " " + entry + " " + block_index);

This method only handles unused blocks (entry = -1) and treats -3 as regular
blocks. I very much suspect it is the reason. 

Here is what the docs say about chain terminators:

"Special values are reserved for chain terminators (ENDOFCHAIN = 0xFFFFFFFE),
free sectors (FREESECT = 0xFFFFFFFF), and sectors that contain storage for Fat
Sectors (FATSECT = 0xFFFFFFFD) or DIF Sectors (DIFSECT = 0xFFFFFFC), which are
not chained in the same way as the others.
The locations of Fat Sectors are read from the DIF (Double-indirect Fat), which
is described below. The Fat is represented in itself, but not by a chain – a
special reserved SECT value (FATSECT = 0xFFFFFFFD) is used to mark sectors
allocated to the Fat. A SECT can be converted into a byte offset into the file
by using the following formula: SECT << ssheader._uSectorShift +
sizeof(ssheader). This implies that sector 0 of the file begins at byte offset
512, not at 0."

Yegor


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to