goldengel / exiflibrary

Automatically exported from code.google.com/p/exiflibrary
MIT License
0 stars 0 forks source link

Library hang reading certain JPG files #39

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

- Using the ExifTest file open the attached JPG the program will hang in the 
section JPEGFile.cs WriteIFD.

Application CPU usage and memory toggling.

Version is latest SVN copy r92

Is this issue specific to a certain image? Attached

Please provide any additional information below.

Original issue reported on code.google.com by ITBeyond...@gmail.com on 15 Aug 2012 at 3:37

Attachments:

GoogleCodeExporter commented 8 years ago
OK I found the issue but not sure what my fix may have destroyed. In line 823 
of the JPEGFile.cs it read:

if (preserveMakerNote && !makerNoteProcessed)
    fillerbytecount = makerNoteOffset - currentdataoffset;
else
    fillerbytecount = 0;

I found that the error occurs when the currentdataoffset is larger then the 
makerNoteOffset thus setting a negative value of fillerbytecount. The value was 
not negative it went to something like 4MB. I changed the line to check for 
this as:

if (preserveMakerNote && !makerNoteProcessed && makerNoteOffset > 
currentdataoffset)
    fillerbytecount = makerNoteOffset - currentdataoffset;
else
    fillerbytecount = 0;

and now the file opens correctly. Does this mod do something bad somewhere 
else. I have a number of these files that seem to cause this issue? I have for 
now installed this mod live on my systems to get around a system hang on a 
production web server that processes hundreds of image files per day.

Original comment by ITBeyond...@gmail.com on 15 Aug 2012 at 4:10

GoogleCodeExporter commented 8 years ago
Thank you. I'm looking into it.

Original comment by oozcitak on 22 Aug 2012 at 11:05

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r93.

Original comment by oozcitak on 22 Aug 2012 at 11:16