pkgsrc/devel/libgphoto2/patches/patch-ac
adam 2f3d9a9f78 Changes 2.3.1:
PTP:
   * Fixed a memory leak in continuous Nikon / Canon capture mode.
Bindings:
   * Moved all bindings into separate packages.
Package / System integration:
   * Add README.packaging file.
   * Removed obsolete print-usb-usermap. Use
     "print-camera-list usb-usermap usbcam" instead.
   * Fix libgphoto2 symbol list: Removed gpi_gphoto_port_type_map
   * Add new permission setup script doing class based matching for
     PTP class cameras not listed explicitly by USB IDs.

Changes 2.3.0:

PTP:
   * Improved Nikon remote control
   * Improved Canon file download
	- faster directory retrieval (especially on cameras with lots of files)
	- "new" images are marked (gphoto2 --new, digikam)
   * MTP Playlist support (upload and download)
   * MTP Metadata support (upload and download, Artist, Title, Playtime ... )
   * Lots of other MTP related fixes.
   * MTP autodetection on Microsoft OS Descriptor.
   * New devices:
          Canon PowerShot A540, A530, S3 IS, SD430, SD600, SD700, IXUS 800
2007-01-02 18:32:47 +00:00

41 lines
1.2 KiB
Text

$NetBSD: patch-ac,v 1.2 2007/01/02 18:32:47 adam Exp $
--- camlibs/ptp2/ptp.c.orig 2006-12-24 16:16:20.000000000 +0100
+++ camlibs/ptp2/ptp.c
@@ -524,6 +524,9 @@ static inline uint16_t
ptp_usb_event (PTPParams* params, PTPContainer* event, int wait)
{
uint16_t ret;
+ uint32_t packetlen;
+ size_t toread;
+ unsigned char *bp;
unsigned int rlen;
PTPUSBEventContainer usbevent;
PTP_CNT_INIT(usbevent);
@@ -533,8 +536,24 @@ ptp_usb_event (PTPParams* params, PTPCon
switch(wait) {
case PTP_EVENT_CHECK:
- ret=params->check_int_func((unsigned char*)&usbevent,
- sizeof(usbevent), params->data, &rlen);
+ ret=params->check_int_func((unsigned char*)&packetlen,
+ sizeof(packetlen), params->data, &rlen);
+ if (ret!=PTP_RC_OK)
+ break;
+ if (rlen != sizeof(packetlen)) {
+ ret = PTP_ERROR_IO;
+ break;
+ }
+ toread = dtoh32(packetlen) - sizeof(packetlen);
+ bp = (unsigned char*)&usbevent.type;
+ while (toread > 0) {
+ ret=params->check_int_func(bp,
+ toread, params->data, &rlen);
+ if (ret!=PTP_RC_OK)
+ break;
+ toread -= rlen;
+ bp += rlen;
+ }
break;
case PTP_EVENT_CHECK_FAST:
ret=params->check_int_fast_func((unsigned char*)