aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2011-01-16 21:39:38 +0000
committerPav Lucistnik <pav@FreeBSD.org>2011-01-16 21:39:38 +0000
commit888f64700e13eef9696a62d35dc07749d0b3af04 (patch)
treee0284478d9f58a3bc5e0b7d8a95af876cd63b669 /graphics
parent691a35bdfd7949f2c056ec3f165f946b57ebfea0 (diff)
downloadports-888f64700e13eef9696a62d35dc07749d0b3af04.tar.gz
ports-888f64700e13eef9696a62d35dc07749d0b3af04.zip
- Fix segfault on certain usb devices
PR: ports/154057 Submitted by: Lucius Windschuh <lwindschuh@gmail.com> Feature safe: yes
Notes
Notes: svn path=/head/; revision=267892
Diffstat (limited to 'graphics')
-rw-r--r--graphics/libgphoto2/Makefile1
-rw-r--r--graphics/libgphoto2/files/patch-libgphoto2_port-usb-libusb.c45
2 files changed, 46 insertions, 0 deletions
diff --git a/graphics/libgphoto2/Makefile b/graphics/libgphoto2/Makefile
index 4b4a4eea1533..94e0382df18f 100644
--- a/graphics/libgphoto2/Makefile
+++ b/graphics/libgphoto2/Makefile
@@ -7,6 +7,7 @@
PORTNAME= libgphoto2
PORTVERSION= 2.4.10.1
+PORTREVISION= 1
CATEGORIES= graphics
MASTER_SITES= SF/gphoto/libgphoto/${PORTVERSION}
diff --git a/graphics/libgphoto2/files/patch-libgphoto2_port-usb-libusb.c b/graphics/libgphoto2/files/patch-libgphoto2_port-usb-libusb.c
new file mode 100644
index 000000000000..08ccf671c47e
--- /dev/null
+++ b/graphics/libgphoto2/files/patch-libgphoto2_port-usb-libusb.c
@@ -0,0 +1,45 @@
+--- libgphoto2_port/usb/libusb.c.old 2011-01-16 15:22:21.000000000 +0100
++++ libgphoto2_port/usb/libusb.c 2011-01-16 15:21:57.000000000 +0100
+@@ -824,23 +824,25 @@
+ * MTP interface descriptions, that's how they can be detected, before
+ * we try the more esoteric "OS descriptors" (below).
+ */
+- for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
+- unsigned int j;
+- for (j = 0; j < dev->config[i].bNumInterfaces; j++) {
+- int k;
+- for (k = 0; k < dev->config[i].interface[j].num_altsetting; k++) {
+- buf[0] = '\0';
+- ret = usb_get_string_simple(devh,
+- dev->config[i].interface[j].altsetting[k].iInterface,
+- (char *) buf,
+- 1024);
+- if (ret < 3)
+- continue;
+- if (strcmp((char *) buf, "MTP") == 0) {
+- gp_log (GP_LOG_DEBUG, "mtp matcher", "Configuration %d, interface %d, altsetting %d:\n", i, j, k);
+- gp_log (GP_LOG_DEBUG, "mtp matcher", " Interface description contains the string \"MTP\"\n");
+- gp_log (GP_LOG_DEBUG, "mtp matcher", " Device recognized as MTP, no further probing.\n");
+- goto found;
++ if(dev->config) {
++ for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
++ unsigned int j;
++ for (j = 0; j < dev->config[i].bNumInterfaces; j++) {
++ int k;
++ for (k = 0; k < dev->config[i].interface[j].num_altsetting; k++) {
++ buf[0] = '\0';
++ ret = usb_get_string_simple(devh,
++ dev->config[i].interface[j].altsetting[k].iInterface,
++ (char *) buf,
++ 1024);
++ if (ret < 3)
++ continue;
++ if (strcmp((char *) buf, "MTP") == 0) {
++ gp_log (GP_LOG_DEBUG, "mtp matcher", "Configuration %d, interface %d, altsetting %d:\n", i, j, k);
++ gp_log (GP_LOG_DEBUG, "mtp matcher", " Interface description contains the string \"MTP\"\n");
++ gp_log (GP_LOG_DEBUG, "mtp matcher", " Device recognized as MTP, no further probing.\n");
++ goto found;
++ }
+ }
+ }
+ }