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 505822 - OverflowException at LibGPhoto2.CameraFile.GetDataAndSize() on PPC
OverflowException at LibGPhoto2.CameraFile.GetDataAndSize() on PPC
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Import
SVN
Other All
: Normal critical
: ---
Assigned To: F-spot maintainers
F-spot maintainers
: 582113 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-12-26 23:59 UTC by Tim Retout
Modified: 2009-05-11 06:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Correct the size argument to be a pointer, not a ulong. (1.65 KB, patch)
2008-06-30 18:35 UTC, Tim Retout
none Details | Review
the patch i'm pushing (1.58 KB, patch)
2008-07-01 10:51 UTC, Stephane Delcroix
committed Details | Review

Description Tim Retout 2007-12-26 23:59:11 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
Comment 1 Tim Retout 2008-06-30 00:43:20 UTC
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.
Comment 2 Tim Retout 2008-06-30 18:35:26 UTC
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.
Comment 3 Stephane Delcroix 2008-07-01 10:44:25 UTC
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;
}
Comment 4 Stephane Delcroix 2008-07-01 10:51:32 UTC
Created attachment 113774 [details] [review]
the patch i'm pushing

am pushing this patch in svn
Comment 5 Stephane Delcroix 2008-07-01 11:01:21 UTC
fixed in r4125
Comment 6 Maxxer 2009-05-11 06:26:33 UTC
*** Bug 582113 has been marked as a duplicate of this bug. ***