GNOME Bugzilla – Bug 505822
OverflowException at LibGPhoto2.CameraFile.GetDataAndSize() on PPC
Last modified: 2009-05-11 06:26:33 UTC
Steps to reproduce: 1. Known to happen with a Canon EOS 350D and a PPC machine. 2. Select File->Import 3. Select the camera as import source Stack trace: cleanup context item ImportCommand+SourceItem Ubuntu 7.10 ppc - gnome-dev-cdrom - Mountpoint file:///media/cdrom0 <file:///media/cdrom0> True True Cdrom Cdrom item ImportCommand+SourceItem Testing gphoto path = usb: PortInfo Universal Serial Bus, usb: cleanup context Exception in Gtk# callback delegate Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception. System.OverflowException: Number overflow. at LibGPhoto2.CameraFile.GetDataAndSize () [0x00000] at GPhotoCamera.GetPreviewPixbuf (.GPhotoCameraFile camfile) [0x00000] at FSpot.CameraFileSelectionDialog.GetPreviews () [0x00000] at FSpot.CameraFileSelectionDialog.CreateInterface () [0x00000] at FSpot.CameraFileSelectionDialog.Run () [0x00000] at MainWindow.ImportCamera (System.String camera_device) [0x00000] at ImportCommand.set_Source (.SourceItem value) [0x00000] at ImportCommand+SourceMenu.HandleActivated (System.Object sender, System.EventArgs args) [0x00000] at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs) at GLib.Signal.voidObjectCallback (IntPtr handle, IntPtr gch) [0x00000] at GLib.Signal.voidObjectCallback () at Gtk.Dialog.gtk_dialog_run () at Gtk.Dialog.gtk_dialog_run () at Gtk.Dialog.Run () at ImportCommand.ImportFromFile () at MainWindow.HandleImportCommand () at System.MulticastDelegate.invoke_void_object_EventArgs () at GLib.Signal.voidObjectCallback () at GLib.Signal.voidObjectCallback () at Gtk.Application.gtk_main () at Gtk.Application.gtk_main () at Gtk.Application.Run () at Gnome.Program.Run () at FSpot.Driver.Main () cleanup context Other information: Previously reported at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439816 https://bugs.launchpad.net/ubuntu/+source/f-spot/+bug/176707
I've now bought a powerpc machine myself, and can confirm this bug with f-spot SVN. I'm using a Fuji Finepix, so I guess it happens with all PTP cameras.
Created attachment 113721 [details] [review] Correct the size argument to be a pointer, not a ulong. This fixes the problem, and has been tested to still work on amd64.
thx for this search and work, but I think I'll pull the changes from the gphoto2 project itself, which checks for null pointer. public byte[] GetDataAndSize () { IntPtr size; byte[] data; IntPtr data_addr; Error.CheckError (gp_file_get_data_and_size (this.Handle, out data_addr, out size)); if(data_addr == IntPtr.Zero || size.ToInt32() == 0) return new byte[0]; data = new byte[size.ToInt32()]; Marshal.Copy(data_addr, data, 0, (int)size.ToInt32()); return data; }
Created attachment 113774 [details] [review] the patch i'm pushing am pushing this patch in svn
fixed in r4125
*** Bug 582113 has been marked as a duplicate of this bug. ***