exif-parser icon indicating copy to clipboard operation
exif-parser copied to clipboard

Reading EXIF information throws exception

Open cajus opened this issue 6 years ago • 1 comments

Trying to examine this image (yes, it is just white) runs into

RangeError [ERR_INDEX_OUT_OF_RANGE]: Index out of range
    at checkOffset (buffer.js:1024:11)
    at Buffer.readUInt16LE (buffer.js:1072:5)
    at BufferStream.nextUInt16 (node_modules/exif-parser/lib/bufferstream.js:24:84)
    at readIFDSection (node_modules/exif-parser/lib/exif.js:86:31)
    at Object.parseTags (node_modules/exif-parser/lib/exif.js:140:4)
    at node_modules/exif-parser/lib/parser.js:143:29
    at Object.parseSections (node_modules/exif-parser/lib/jpeg.js:21:4)
    at Parser.parse (node_modules/exif-parser/lib/parser.js:140:8)

, while the ordinary exif tool on the command line succeeds without any problems.

The latest PR added some robustness code at exactly the same position, but it doesn't seem to help here. Looks like it reads from an out of range offset instead. I'm not deep enough in this stuff to decide if the EXIF information is broken or if there's a LE/BE problem in the offset decoding.

Any idea?

cajus avatar Aug 24 '18 19:08 cajus