Closed Ploaj closed 1 week ago
I cannot seem to reproduce this problem by clicking after the end of a document in the example application. Could you specify the exact steps and OS environment you're running on?
https://github.com/user-attachments/assets/05788a34-9fc2-44de-8bea-b97a7e61846f
Windows 11
Hope that explains it well enough!
This is not a bug of ByteArrayBinaryDocument
but of the hex editor not calling IBinaryDocument.ReadBytes
properly.
Potential fix is in #9, if you could verify this solves the problem for you, that would be great.
https://github.com/Washi1337/AvaloniaHex/blob/ed3631074c288ecc8f36c68acc9623a19af20b04/src/AvaloniaHex/Document/ByteArrayBinaryDocument.cs#L57
If the offset >= Length, which can occur by clicking after the end of a document, an out of range exception will occur.