Skip to content

Commit

Permalink
ENH - gracefully deal with slightly invalid FIFF-files
Browse files Browse the repository at this point in the history
  • Loading branch information
schoffelen committed Nov 8, 2024
1 parent d4679ec commit a153aaf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions external/mne/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ The m-files in this folder have been synchronised with respect to the below comm
20240129:
https://github.com/mne-tools/mne-matlab/commit/75059ed0798a6f25123906fe3acc8e3a16f3b8f9

20241108:
https://github.com/mne-tools/mne-matlab/commit/5a8a5e180026e981468aaf39f5c5dffcc299d726
18 changes: 14 additions & 4 deletions external/mne/fiff_read_tag_info.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,23 @@
%
%

me='MNE:fiff_read_tag_info';

FIFFV_NEXT_SEQ=0;

data = fread(fid,4,'int');
tag.kind = data(1);
tag.type = data(2);
tag.size = data(3);
tag.next = data(4);
if ~isempty(data)
tag.kind = data(1);
tag.type = data(2);
tag.size = data(3);
tag.next = data(4);
else
warning(me,'Invalid tag found');
tag.kind = [];
tag.type = [];
tag.size = [];
tag.next = [];
end

if tag.next == FIFFV_NEXT_SEQ
fseek(fid,tag.size,'cof');
Expand Down

0 comments on commit a153aaf

Please sign in to comment.