Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDT: fix NegativeArraySizeException when reading files recorded by SPCM64 9.90 #4198

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

cqian89
Copy link
Contributor

@cqian89 cqian89 commented Jun 18, 2024

I encountered a java.lang.NegativeArraySizeException when reading files recorded by the latest version (9.90) of Becker Hickl's SPCM64 software. Files recorded with older versions don't seem to have this issue.

On further investigation, it seems to be related to a value setupLength. This should be an unsigned short, but was read as a signed short previously. In the SDT files recorded by the latest SPCM64, this seems to have exceeded the range of a signed short but is still within range of an unsigned short.

This PR fixes the error by changing readShort to readUnsignedShort and the type of setupLength to int.

Test data here: https://doi.org/10.5281/zenodo.12094862

@melissalinkert
Copy link
Member

Thanks, @cqian89. This change makes sense to me, so it will be included in tonight's CI builds to see if any of our existing SDT test files are affected.

Before merging this pull request, we will need to have a signed Contributor License Agreement. Please submit the CLA according to the instructions here: https://ome-contributing.readthedocs.io/en/latest/cla.html

@cqian89
Copy link
Contributor Author

cqian89 commented Jun 19, 2024

Thank you. I just submitted the signed CLA as per the instructions.

@sbesson sbesson merged commit 8f83c44 into ome:develop Sep 3, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants