diff --git a/src/oceanic_common.c b/src/oceanic_common.c index 09dac64..dc4bdf8 100644 --- a/src/oceanic_common.c +++ b/src/oceanic_common.c @@ -63,7 +63,10 @@ get_profile_first (const unsigned char data[], const oceanic_common_layout_t *la value = array_uint16_le (data + 4); } - return (value & 0x0FFF) * PAGESIZE; + if (layout->memsize > 0x10000) + return (value & 0x1FFF) * PAGESIZE; + else + return (value & 0x0FFF) * PAGESIZE; } @@ -78,7 +81,10 @@ get_profile_last (const unsigned char data[], const oceanic_common_layout_t *lay value = array_uint16_le (data + 6); } - return (value & 0x0FFF) * PAGESIZE; + if (layout->memsize > 0x10000) + return (value & 0x1FFF) * PAGESIZE; + else + return (value & 0x0FFF) * PAGESIZE; }