Re: Escher images

On Fri, Jan 16, 2004 at 02:55:54PM +0000, Nick Lamb wrote:
It looks to me like the check on opcode for BIFF records in an Escher
container is overly strict. I have a file here which contains a chart
with a massive JPEG background. Current 1.2 CVS crashes while trying to
handle that part of the document, but by adding BIFF_CHART_gelframe to the
list the JPEG is merely ignored (presumably not yet supported). Does
that make sense? Obviously the crash when an opcode doesn't match should
be fixed too, but I had no time to fully diagnose that.

My test document is XOR encrypted, and therefore can't be opened without
the XOR crypto patch (or its predecessor). The change needed to open this
without crashing is inline at the bottom of this mail, it's a one liner.
Unfortunately the document is not only encrypted, it's also confidential,
so if someone needs to take a look (Jody?) they'll have to email me off
list and agree to use it for research only and then destroy it.

diff -u -r1.100 ms-escher.c
--- ms-escher.c 14 Dec 2003 04:58:24 -0000      1.100
+++ ms-escher.c 16 Jan 2004 14:46:07 -0000
@@ -210,6 +210,7 @@
                        if (q->opcode != BIFF_MS_O_DRAWING &&
                            q->opcode != BIFF_MS_O_DRAWING_GROUP &&
                            q->opcode != BIFF_MS_O_DRAWING_SELECTION &&
+                           q->opcode != BIFF_CHART_gelframe &&
                            q->opcode != BIFF_CONTINUE) {
                                g_warning ("Unexpected record type 0x%x @ 0x%x;", q->opcode, q->streamPos);
                                return NULL;

Good catch.  That area is fairly murky.  I've made a similar change
in the initial check too.   We probably don't need that.  I suspect
that it would be more correct for us to expect just one record type
that would be defined by the initial record.

eg all draws or all gelframes

I wonder if we even need CONTINUE ...

Applied to HEAD and 1.2.  It will be in 1.2.5 this weekend.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]