text file processed as quicktime - large memory consumption

Started by Archive, May 12, 2010, 08:54:06 AM

Previous topic - Next topic

Archive

[Originally posted by humyo on 2007-07-17 12:54:12-07]

Hi,

Running exiftool on a file containing just the text 'Candidate' results in it trying to allocate a very large chunk (~1.5Gbyte) of virtual mem (and hence dying if run under 'ulimit -v 500000').

This seems to be because Image::ExifTool::QuickTime::ProcessMOV finds 'idat' at bytes 4-7 of the file  (and gets a huge size value) and then proceeds to call 'Read' in the loop with this size.

Are there perhaps any additional checks which could be done on the tag (is 'idat' valid as the first tag?) or perhaps an upper bound on the size?

Also, in the case where a file has been renamed (or is being passed to Image::ExifTool via an open perl filehandle), would it help avoid this sort of problem if it were possible to pass in the original file extension, to avoid all possible matching engines being used?

Thanks again for all your help so far.

Archive

[Originally posted by exiftool on 2007-07-17 15:19:36-07]

Your testing and feedback has been very useful, thanks!

I have updated the
https://exiftool.org/Image-ExifTool-6.94.tar.gz" target="_blank">6.94
pre-release with version that should fix your MOV problem.

I will think about how it is best to handle file types via the API -- I should be able
to come up with something to help out here too.

- Phil