diff options
author | martin <martin> | 2016-03-15 09:14:03 +0000 |
---|---|---|
committer | martin <martin> | 2016-03-15 09:14:03 +0000 |
commit | cd3246377de08f217c1715117635c6e34c1ed311 (patch) | |
tree | ef6c38397ba4f92611ad402c7d4a80291f3fddad /graphics/sane-backends | |
parent | a3bdbfbb58cf6c9216f38a156df00cd911e76cce (diff) | |
download | pkgsrc-cd3246377de08f217c1715117635c6e34c1ed311.tar.gz |
Fix usb bulk reads on big endian 64bit platforms.
Closes PR pkg/50340.
Diffstat (limited to 'graphics/sane-backends')
-rw-r--r-- | graphics/sane-backends/Makefile | 4 | ||||
-rw-r--r-- | graphics/sane-backends/distinfo | 3 | ||||
-rw-r--r-- | graphics/sane-backends/patches/patch-sanei_sanei_usb.c | 35 |
3 files changed, 39 insertions, 3 deletions
diff --git a/graphics/sane-backends/Makefile b/graphics/sane-backends/Makefile index 542e4141130..f3beb97d622 100644 --- a/graphics/sane-backends/Makefile +++ b/graphics/sane-backends/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.65 2016/03/05 11:28:41 jperkin Exp $ +# $NetBSD: Makefile,v 1.66 2016/03/15 09:14:03 martin Exp $ -PKGREVISION= 2 +PKGREVISION= 3 .include "Makefile.common" COMMENT= API for access to scanners, digital cameras, frame grabbers, etc diff --git a/graphics/sane-backends/distinfo b/graphics/sane-backends/distinfo index 34bf85b9043..831a072287a 100644 --- a/graphics/sane-backends/distinfo +++ b/graphics/sane-backends/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.42 2015/11/11 12:40:03 wiz Exp $ +$NetBSD: distinfo,v 1.43 2016/03/15 09:14:03 martin Exp $ SHA1 (sane-backends-1.0.25.tar.gz) = 05824922d91571e1fc2f5cdd270745783d593754 RMD160 (sane-backends-1.0.25.tar.gz) = 1cfd81eeddf3ef3c2cea98f6ca7640522b249fab @@ -15,3 +15,4 @@ SHA1 (patch-ak) = f00d3773c14f9955565debc0d16231906a2bba76 SHA1 (patch-backend_kodakaio.c) = f96af8b2fb0369f51d2320285253c5e67218e629 SHA1 (patch-backend_pieusb__buffer.c) = 7e7c6dbb0798876532a04a0831be2ab2bd2931ca SHA1 (patch-sanei_sanei__ir.c) = 66e913d7db9d03a42850778aca39da8f0dde02fa +SHA1 (patch-sanei_sanei_usb.c) = b053c94d240580d919c418081fca5c75cf4fb1a7 diff --git a/graphics/sane-backends/patches/patch-sanei_sanei_usb.c b/graphics/sane-backends/patches/patch-sanei_sanei_usb.c new file mode 100644 index 00000000000..1099d63a4bb --- /dev/null +++ b/graphics/sane-backends/patches/patch-sanei_sanei_usb.c @@ -0,0 +1,35 @@ +$NetBSD: patch-sanei_sanei_usb.c,v 1.1 2016/03/15 09:14:03 martin Exp $ + +Avoid storing an int (the number of bytes transfered) in the wrong +half of a ssize_t on big endian 64bit platforms. + +Reported upstream as: +https://alioth.debian.org/tracker/index.php?func=detail&aid=315337 + + +--- sanei/sanei_usb.c.orig 2014-12-16 14:37:26.000000000 +0100 ++++ sanei/sanei_usb.c 2016-03-15 09:12:34.335049822 +0100 +@@ -2310,10 +2310,10 @@ sanei_usb_read_bulk (SANE_Int dn, SANE_B + { + if (devices[dn].bulk_in_ep) + { +- int ret; ++ int ret, rsize; + ret = libusb_bulk_transfer (devices[dn].lu_handle, + devices[dn].bulk_in_ep, buffer, +- (int) *size, (int *) &read_size, ++ (int) *size, &rsize, + libusb_timeout); + + if (ret < 0) +@@ -2323,6 +2323,10 @@ sanei_usb_read_bulk (SANE_Int dn, SANE_B + + read_size = -1; + } ++ else ++ { ++ read_size = rsize; ++ } + } + else + { |