Skip to content

Commit 6b2f431

Browse files
author
Vincent Wilms
committed
Fixes #153: Exception thrown reading strings
1 parent 29ae16c commit 6b2f431

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## v2.1.2 - 2026-03-17
2+
3+
### Bugs fixed
4+
- The global heap collection was not read properly. (#153)
5+
16
## v2.1.1 - 2024-08-16
27

38
### Bugs fixed

src/PureHDF/VOL/Native/FileFormat/Level1/GlobalHeap/GlobalHeapCollection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ readonly get
4444
public static GlobalHeapCollection Decode(NativeReadContext context)
4545
{
4646
// TODO: do not decode individual global heap objects and use a Memory<byte> of size 4096 instead
47-
47+
4848
var (driver, superblock) = context;
4949

5050
// signature
@@ -64,7 +64,7 @@ public static GlobalHeapCollection Decode(NativeReadContext context)
6464
var globalHeapObjects = new Dictionary<int, GlobalHeapObject>();
6565

6666
var headerSize = 8UL + superblock.LengthsSize;
67-
var remaining = collectionSize;
67+
var remaining = collectionSize - headerSize;
6868

6969
while (remaining > headerSize)
7070
{
@@ -83,8 +83,8 @@ public static GlobalHeapCollection Decode(NativeReadContext context)
8383
}
8484

8585
return new GlobalHeapCollection(
86-
GlobalHeapObjects: globalHeapObjects
87-
)
86+
GlobalHeapObjects: globalHeapObjects
87+
)
8888
{
8989
Version = version,
9090
CollectionSize = collectionSize

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "2.1.1",
2+
"version": "2.1.2",
33
"suffix": ""
44
}

0 commit comments

Comments
 (0)