Commit 0863769
committed
fix(fiff): fall back to header walk when DIR_POINTER points past EOF [#K1]
Observed on ds002885 (169 MB FIFF): DIR_POINTER payload = 911,773,376
(0x36588EC0), well past the 168,755,200-byte EOF. parseDirectory threw
"dir at abs 911773376 not inside view" and the whole open() failed.
MNE-Python's _fiff/open.py:183-192 treats out-of-range DIR_POINTER the
same as the -1 sentinel: fall back to sequential header walk. We now
match that behaviour, gated on `dirOffset < 0 || dirOffset >= totalBytes`.
Also wrap the in-range parseDirectory call in try/catch so any
malformed-tag error at the claimed offset triggers the walk fallback
instead of crashing.
After the fix, ds002885 walks the head and correctly identifies the
file as a calibration-only FIFF (no FIFFB_RAW_DATA block), joining
ds003392 and ds003352 in the documented intentional-rejection bucket.1 parent 2ea3e5c commit 0863769
1 file changed
Lines changed: 23 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
434 | 435 | | |
435 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
436 | 439 | | |
437 | 440 | | |
438 | 441 | | |
439 | 442 | | |
440 | 443 | | |
441 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
442 | 454 | | |
443 | 455 | | |
444 | 456 | | |
| |||
0 commit comments