f-spot r3593 - in trunk: . src/Imaging



Author: sdelcroix
Date: Wed Jan 23 13:46:19 2008
New Revision: 3593
URL: http://svn.gnome.org/viewvc/f-spot?rev=3593&view=rev

Log:
2008-01-23  Stephane Delcroix  <sdelcroix novell com>

	* src/Imaging/Tiff.cs: reverting 3591, trying to detect recursion.


Modified:
   trunk/ChangeLog
   trunk/src/Imaging/Tiff.cs

Modified: trunk/src/Imaging/Tiff.cs
==============================================================================
--- trunk/src/Imaging/Tiff.cs	(original)
+++ trunk/src/Imaging/Tiff.cs	Wed Jan 23 13:46:19 2008
@@ -1504,6 +1504,8 @@
 			for (int i = 0; i <  entry_count; i++) {
 				try {
 					directory_offset = BitConverter.ToUInt32 (raw_data, i * 4, endian == Endian.Little);
+					if (directory_offset == offset_origin + 8)
+						throw new Exception ("recursive ifd");
 					Directory [i] = new ImageDirectory (stream, directory_offset, endian);
 				} catch (System.Exception e) {
 					System.Console.WriteLine ("Error loading Subdirectory {0} at {2} of {3}bytes:{4}{1}", 
@@ -1712,7 +1714,6 @@
 
 		public virtual void LoadExternal (System.IO.Stream stream)
 		{
-			raw_data = null;
 			if (data_offset != 0) {
 				stream.Seek ((long)Position, System.IO.SeekOrigin.Begin);
 				byte [] data = new byte [count * GetTypeSize ()];



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]