Comparing version 0.2.0 to 1.0.0
@@ -118,4 +118,10 @@ var Writable = require('stream').Writable, | ||
tagObj.dataSize = size.value; | ||
tagObj.end += size.value + size.length; | ||
// unknown size | ||
if (size.value === -1) { | ||
tagObj.end = -1; | ||
} else { | ||
tagObj.end += size.value + size.length; | ||
} | ||
debug('read size: ' + size.value); | ||
@@ -122,0 +128,0 @@ |
@@ -20,4 +20,6 @@ var tools = { | ||
if (value >= Math.pow(2, 53 - 8) && buffer[start + 7] > 0) { | ||
throw new Error("Unrepresentable value: " + | ||
buffer.toString('hex', start, start + length)); | ||
return { | ||
length: length, | ||
value: -1 | ||
}; | ||
} | ||
@@ -24,0 +26,0 @@ } |
{ | ||
"name": "ebml", | ||
"version": "0.2.0", | ||
"version": "1.0.0", | ||
"description": "ebml parser", | ||
@@ -16,9 +16,3 @@ "main": "index.js", | ||
}, | ||
"keywords": [ | ||
"ebml", | ||
"webm", | ||
"mkv", | ||
"matroska", | ||
"format" | ||
], | ||
"keywords": ["ebml", "webm", "mkv", "matroska", "format"], | ||
"dependencies": { | ||
@@ -39,2 +33,18 @@ "buffers": "^0.1.1", | ||
"author": "Mark Schmale <masch@masch.it>", | ||
"contributors": [{ | ||
"name": "Chris Price", | ||
"email": "price.c@gmail.com" | ||
}, { | ||
"name": "Manuel Wiedenmann", | ||
"email": "manuel@funkensturm.de" | ||
}, { | ||
"name": "Ed Markowski", | ||
"email": "siphon@protonmail.com" | ||
}, { | ||
"name": "Davy Van Deursen", | ||
"email": "d.vandeursen@evs.com" | ||
}, { | ||
"name": "Max Ogden", | ||
"email": "max@maxogden.com" | ||
}], | ||
"license": "MIT", | ||
@@ -41,0 +51,0 @@ "bugs": { |
@@ -27,6 +27,9 @@ # EBML [![Build Status](https://travis-ci.org/themasch/node-ebml.png?branch=master)](https://travis-ci.org/themasch/node-ebml) | ||
(in alphabetical order) | ||
* [Chris Price](https://github.com/chrisprice) | ||
* [Davy Van Deursen](https://github.com/dvdeurse) | ||
* [Ed Markowski](https://github.com/siphontv) | ||
* [Manuel Wiedenmann](https://github.com/fsmanuel) | ||
* [Mark Schmale](https://github.com/themasch) | ||
* [Max Ogden](https://github.com/maxogden) |
@@ -59,11 +59,8 @@ var ebml = require('../lib/ebml/index.js'), | ||
}); | ||
it('should throw for more than max representable JS number (2^53 + 1)', function() { | ||
assert.throws(function() { | ||
ebml.tools.readVint(new Buffer([0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])); | ||
}, /Unrepresentable value/); | ||
// an unknown value is represented by -1 | ||
it('should return value -1 for more than max representable JS number (2^53 + 1)', function() { | ||
readVint(new Buffer([0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]), -1); | ||
}); | ||
it('should throw for more than max representable JS number (8 byte int max value)', function() { | ||
assert.throws(function() { | ||
ebml.tools.readVint(new Buffer([0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])); | ||
}, /Unrepresentable value/); | ||
it('should return value -1 for more than max representable JS number (8 byte int max value)', function() { | ||
readVint(new Buffer([0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]), -1); | ||
}); | ||
@@ -70,0 +67,0 @@ it('should throw for 9+ byte int values', function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
311761
2634
1
35