gomfunkel / node-exif

A node.js library to extract Exif metadata from images.
MIT License
581 stars 104 forks source link

Safe check makernote #46

Open automata opened 8 years ago

automata commented 8 years ago

With the following image it crashes by a forever loop thanks the presence of undefined offset on makernote buffer:

https://the-grid-user-content.s3-us-west-2.amazonaws.com/d6a8cf7a-ff71-48ee-9241-9766849fd8d6.jpg

automata commented 8 years ago

Added more safe checks for all formats, preventing infinite loops.

It's not a WIP anymore, please consider the merge, @gomfunkel, @oeuillot.

oeuillot commented 8 years ago

I have commented https://github.com/automata/node-exif/commit/aae0918ea6b9231ab6854bf3805af8f94b686e08

Regards,

automata commented 8 years ago

Yep, it breaks some invalid makenotes, something that was fixed by a recent commit. However, I left those safe checks just in case.

automata commented 8 years ago

BTW it would be interesting to have some tests on real images, I have a bunch on noflo-exif which has node-exif as dependency.