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

Fix crash in header parsing when trace count is parsing block_size + 1 #477

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/mdio/segy/_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ def header_scan_worker(
non_void_fields = [(name, dtype) for name, (dtype, _) in fields.items()]
new_dtype = np.dtype(non_void_fields)

# Allocate empty memory and assign non-void fields
trace_header_filtered = np.empty_like(trace_header, dtype=new_dtype)
trace_header_filtered[:] = trace_header
# Copy to non-padded memory, ndmin is to handle the case where there is
# 1 trace in block (singleton) so we can concat and assign stuff later.
trace_header = np.array(trace_header, dtype=new_dtype, ndmin=1)

return cast(HeaderArray, trace_header_filtered)
return cast(HeaderArray, trace_header)


def trace_worker(
Expand Down
Loading