Skip to content

Commit

Permalink
Merge pull request #27 from doejon/master
Browse files Browse the repository at this point in the history
Fixes 'Offset is outside the bounds of the DataView' error
  • Loading branch information
bwindels authored Mar 15, 2018
2 parents 979c143 + b6c4e0c commit 1b08791
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/exif.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ function readExifTag(tiffMarker, stream) {
}

function readIFDSection(tiffMarker, stream, iterator) {
// make sure we can read nextUint16 byte
if (stream.remainingLength() < 2){
return;
}
var numberOfEntries = stream.nextUInt16(), tag, i;
for(i = 0; i < numberOfEntries; ++i) {
tag = readExifTag(tiffMarker, stream);
Expand Down Expand Up @@ -162,4 +166,4 @@ module.exports = {
}
return true;
}
};
};

0 comments on commit 1b08791

Please sign in to comment.