jokiazhang / metadata-extractor

Automatically exported from code.google.com/p/metadata-extractor
0 stars 0 forks source link

IccReader -- OutOfMemoryError #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
IccReader fails with OutOfMemoryError on  
http://www.aten.bg/pict/prod/aten_2l-1030pc.jpg

It seems that check condition is insufficient in IccReader.java:94 -- (tagPtr + 
tagLen) gives negative value. Thus the condition passes.

Original issue reported on code.google.com by gud...@gmail.com on 29 May 2011 at 11:22

GoogleCodeExporter commented 9 years ago
Thanks for the report.  Will have a look now.  Am attaching the file to this 
issue as a permanent record.

Original comment by drewnoakes on 29 May 2011 at 12:02

Attachments:

GoogleCodeExporter commented 9 years ago
This was a great find.  I've created a unit test that reproduced the issue 
using the data from this file.  I also created a small unit test that caused 
this error with the BufferReader class I created to make all byte[] reads safe. 
 Seems this integer overflow case was missed.  I also updated IccReader to use 
the BufferReader in this case (as all code should, for this very reason.)  This 
improvement covers reading of all metadata types, not just ICC.

Thanks again for the report!  Fixed in r106.  Please review if you have a 
chance.

Original comment by drewnoakes on 29 May 2011 at 2:44

GoogleCodeExporter commented 9 years ago
Make that r107 -- I missed some files in the last commit :)

Original comment by drewnoakes on 29 May 2011 at 2:47

GoogleCodeExporter commented 9 years ago
Thanks! Really fast fix!

I parsed 500K+ images without errors.

Original comment by gud...@gmail.com on 30 May 2011 at 2:35

GoogleCodeExporter commented 9 years ago
That's great news.  Thanks for getting back to me.

Original comment by drewnoakes on 30 May 2011 at 2:41