Skip to content

Commit

Permalink
Resistence to partially loaded EBML header.
Browse files Browse the repository at this point in the history
  • Loading branch information
vbence committed Jan 11, 2015
1 parent 01cb417 commit 4740dc3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/org/czentral/incubator/streamm/HeaderDetectionState.java
Expand Up @@ -59,7 +59,12 @@ public int process(byte[] buffer, int offset, int length) {
EBMLElement elem;

// EBML root element
elem = new EBMLElement(buffer, offset, length);
try {
elem = new EBMLElement(buffer, offset, length);
} catch (RuntimeException e) {
// on EBML reading errors, need more data to be loaded
return 0;
}

// if not EBML
if (elem.getId() != ID_EBML)
Expand Down

0 comments on commit 4740dc3

Please sign in to comment.