beacon-biosignals / EDF.jl

Read and write EDF files in Julia
MIT License
18 stars 5 forks source link

Avoid bounds errors while accessing signal data for writing #12

Closed ararslan closed 4 years ago

ararslan commented 5 years ago

The computed stopping point for writing signal chunks may exceed the length of the actual data, resulting in a bounds error. To fix that, we can just take the minimum of the computed stop and the actual length.

Should have a test. Came across this case in the wild.

ararslan commented 5 years ago

@jrevels, any ideas for an appropriate test? I was playing around the other day to try to trigger this case but couldn't determine how, likely because I don't really understand why this occurs, only that this PR fixes it when it does. 😛

ararslan commented 4 years ago

yolo