Commit 75990566 authored by Michael Meeks's avatar Michael Meeks Committed by Michael Meeks

Update so we can't miss adjacent records and we check for continues.

2000-06-05  Michael Meeks  <michael@helixcode.com>

	* ms-excel-read.c (sst_bound_check): Update so we can't miss
	adjacent records and we check for continues.
parent 3a33d315
2000-06-05 Michael Meeks <michael@helixcode.com>
* ms-excel-read.c (sst_bound_check): Update so we can't miss
adjacent records and we check for continues.
2000-06-03 Michael Meeks <michael@helixcode.com> 2000-06-03 Michael Meeks <michael@helixcode.com>
* ms-obj.c (ms_read_TXO): fix memory corruption bug with continue. * ms-obj.c (ms_read_TXO): fix memory corruption bug with continue.
......
...@@ -72,21 +72,28 @@ ms_excel_unexpected_biff (BiffQuery *q, char const *const state) ...@@ -72,21 +72,28 @@ ms_excel_unexpected_biff (BiffQuery *q, char const *const state)
**/ **/
static guint static guint
biff_guint16_hash (const guint16 *d) biff_guint16_hash (const guint16 *d)
{ return *d*2; } {
return *d*2;
}
static guint static guint
biff_guint32_hash (const guint32 *d) biff_guint32_hash (const guint32 *d)
{ return *d*2; } {
return *d*2;
}
static gint static gint
biff_guint16_equal (const guint16 *a, const guint16 *b) biff_guint16_equal (const guint16 *a, const guint16 *b)
{ {
if (*a == *b) return 1; if (*a == *b)
return 1;
return 0; return 0;
} }
static gint static gint
biff_guint32_equal (const guint32 *a, const guint32 *b) biff_guint32_equal (const guint32 *a, const guint32 *b)
{ {
if (*a == *b) return 1; if (*a == *b)
return 1;
return 0; return 0;
} }
...@@ -276,10 +283,15 @@ sst_bound_check (BiffQuery *q, guint32 offset) ...@@ -276,10 +283,15 @@ sst_bound_check (BiffQuery *q, guint32 offset)
{ {
if (offset >= q->length) { if (offset >= q->length) {
guint32 d = offset - q->length; guint32 d = offset - q->length;
guint16 opcode;
if (!ms_biff_query_peek_next (q, &opcode) ||
opcode != BIFF_CONTINUE)
return 0;
if (!ms_biff_query_next (q)) if (!ms_biff_query_next (q))
return 0; return 0;
else
return d; return d;
} else } else
return offset; return offset;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment