History

correctly treat unknown data size and invalid elements in mcfs itself

Sigrid Solveig Haflínudóttir committed 5 years ago

Commit 4f2bb7a1 parent a23fcf01 file · +9 −4Browse files

Unified · Split

matroska.c+9−4
@@ -220,6 +220,8 @@ matroskarun(Biobuf *f) · 219 unmodified lines
220 werrstr("invalid ebml: %r at %#llx (size %lld)", off, sz);220 werrstr("invalid ebml: %r at %#llx (size %lld)", off, sz);
221 goto err;221 goto err;
222 }222 }
223 if(el.type < 0)
224 continue;
223 if(n == 0) /* eof */225 if(n == 0) /* eof */
224 break;226 break;
225 left -= n;227 left -= n;
@@ -231,7 +233,8 @@ matroskarun(Biobuf *f) · 5 unmodified lines
231 }233 }
232 isebml++;234 isebml++;
233 }else if(el.id == ESegment){235 }else if(el.id == ESegment){
234 left = sz;236 if(sz > 0)
237 left = sz;
235 if(isebml != 1){238 if(isebml != 1){
236 werrstr("invalid ebml");239 werrstr("invalid ebml");
237 goto err;240 goto err;
@@ -439,9 +442,11 @@ matroskarun(Biobuf *f) · 201 unmodified lines
439 getstring(ELanguage, e.lang)442 getstring(ELanguage, e.lang)
440 }443 }
441 444
442 if(Bseek(f, sz, 1) < 0)445 if(sz > 0){
443 return -1;446 if(Bseek(f, sz, 1) < 0)
444 left -= sz;447 return -1;
448 left -= sz;
449 }
445 }450 }
446 451
447 if(isebml == 2 && left == 0){452 if(isebml == 2 && left == 0){

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t