After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625024 - Crash on importing file with invalid (?) metadata
Crash on importing file with invalid (?) metadata
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Metadata
GIT
Other Linux
: Normal normal
: 0.7.2
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2010-07-22 10:56 UTC by Paul Wellner Bou
Modified: 2010-07-22 12:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase (61.88 KB, image/jpeg)
2010-07-22 10:57 UTC, Paul Wellner Bou
Details

Description Paul Wellner Bou 2010-07-22 10:56:36 UTC
[1 Warn  12:50:22.138] Caught an exception - System.Exception: Invalid IFD offset 3948492, length: 63363 (in `TagLib')
  at TagLib.IFD.IFDReader.ReadIFD (Int64 base_offset, UInt32 offset, UInt32 max_offset) [0x00170] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:301 
  at TagLib.IFD.IFDReader.Read (Int32 count) [0x0003b] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:181 
  at TagLib.IFD.IFDReader.Read () [0x00000] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:151 
  at TagLib.IFD.IFDReader.ParseIFDEntry (UInt16 tag, UInt16 type, UInt32 count, Int64 base_offset, UInt32 offset) [0x00138] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:926 
  at TagLib.IFD.IFDReader.CreateIFDEntry (UInt16 tag, UInt16 type, UInt32 count, Int64 base_offset, TagLib.ByteVector offset_data, UInt32 max_offset) [0x00023] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:345 
  at TagLib.IFD.IFDReader.ReadIFD (Int64 base_offset, UInt32 offset, UInt32 max_offset) [0x000fa] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:286 
  at TagLib.IFD.IFDReader.Read (Int32 count) [0x0003b] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:181 
  at TagLib.IFD.IFDReader.Read () [0x00000] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:151 
  at TagLib.IFD.IFDReader.ParseIFDEntry (UInt16 tag, UInt16 type, UInt32 count, Int64 base_offset, UInt32 offset) [0x00138] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:926 
  at TagLib.IFD.IFDReader.CreateIFDEntry (UInt16 tag, UInt16 type, UInt32 count, Int64 base_offset, TagLib.ByteVector offset_data, UInt32 max_offset) [0x00023] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:345 
  at TagLib.IFD.IFDReader.ReadIFD (Int64 base_offset, UInt32 offset, UInt32 max_offset) [0x000fa] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:286 
  at TagLib.IFD.IFDReader.Read (Int32 count) [0x0003b] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:181 
  at TagLib.IFD.IFDReader.Read () [0x00000] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:151 
  at TagLib.Jpeg.File.ReadAPP1Segment (UInt16 length) [0x000d2] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:454 
  at TagLib.Jpeg.File.ReadMetadata () [0x000b6] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:367 
  at TagLib.Jpeg.File.Read (ReadStyle propertiesStyle) [0x0001d] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:246 
  at TagLib.Jpeg.File..ctor (IFileAbstraction abstraction, ReadStyle propertiesStyle) [0x00007] in /usr/src/f-spot/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:167 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. (in `mscorlib')
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] 
  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] 
  at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] 
  at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] 
  at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] 
  at FSpot.Imaging.ImageFile.Create (Hyena.SafeUri uri) [0x0001e] in /usr/src/f-spot/src/Imaging/ImageFile.cs:128 


I think we have a general problem here: It is ok, that TagLib throws an Exception, but F-Spot should not crash then. The problem is that F-Spot gets the files by extension (JPG) and the first creation of an Image Object is done while loading the thumbnail (with the delegate in main.cs).

There should be something before. If the image is not parsable/readable/has 0 bytes/whatever, it should not be added to the list of files to import.
Comment 1 Paul Wellner Bou 2010-07-22 10:57:10 UTC
Created attachment 166372 [details]
Testcase
Comment 2 Ruben Vermeersch 2010-07-22 12:54:24 UTC
Fixed, thanks for reporting! This corruption is now detected. Files that have it will not be rewritten.