diff options
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/0185-fix_memory.patch | 62 | ||||
-rw-r--r-- | debian/patches/0190-Fix_scanimage_help.patch | 20 | ||||
-rw-r--r-- | debian/patches/0205-ftbfs_with_GCC-15.patch | 22 | ||||
-rw-r--r-- | debian/patches/series | 3 |
4 files changed, 107 insertions, 0 deletions
diff --git a/debian/patches/0185-fix_memory.patch b/debian/patches/0185-fix_memory.patch new file mode 100644 index 0000000..137ae31 --- /dev/null +++ b/debian/patches/0185-fix_memory.patch @@ -0,0 +1,62 @@ +Description: Fix memory handling at backend/hp5590_low.c +Author: +Origin: upstream, https://gitlab.com/sane-project/backends/-/merge_requests/857 +Bug: https://gitlab.com/sane-project/backends/-/issues/782 + https://gitlab.com/sane-project/backends/-/issues/781 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071658 + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071660 +Forwarded: not-needed +Applied-Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/857 +Last-Update: 2024-12-08 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +diff --git a/backend/hp5590.c b/backend/hp5590.c +index 78c93132558365c8005c45fb756da57d1dfe9005..56acfb13c308f889daba472e05f1a03bb5967d18 100644 +--- a/backend/hp5590.c ++++ b/backend/hp5590.c +@@ -2154,6 +2154,24 @@ sane_read_internal (struct hp5590_scanner * scanner, SANE_Byte * data, + max_length, + scanner->transferred_image_size); + ++ /* ++ * We will truncate down the buffer size to *under* what the ++ * internal USB reading buffer can supply. This will avoid page read issues ++ * at the end of the buffer. ++ * ++ * See: https://gitlab.com/sane-project/backends/-/issues/781 ++ * ++ */ ++ if (max_length > BULK_READ_PAGE_SIZE * MAX_READ_PAGES) ++ { ++ DBG (DBG_proc, "%s, truncating sane_read buffer from %u to %u\n", ++ __func__, ++ max_length, ++ BULK_READ_PAGE_SIZE * MAX_READ_PAGES); ++ ++ max_length = BULK_READ_PAGE_SIZE * MAX_READ_PAGES; ++ } ++ + SANE_Int length_limited = 0; + *length = max_length; + if ((unsigned long long) *length > scanner->transferred_image_size) +diff --git a/backend/hp5590_low.c b/backend/hp5590_low.c +index 2d19dcf951717919099995a402002e1d18822849..7038f438640c72ede3b9d01d09d14b750f2c0041 100644 +--- a/backend/hp5590_low.c ++++ b/backend/hp5590_low.c +@@ -99,9 +99,15 @@ struct usb_in_usb_ctrl_setup { + #define CORE_FLAG_NOT_READY 1 << 1 + + /* Bulk transfers are done in pages, below their respective sizes */ ++/* ++ * Note that we limit the amount we can supply to sane_read() to avoid ++ * clashes with the size of the internal read buffer. ++ * ++ */ + #define BULK_WRITE_PAGE_SIZE 0x0f000 + #define BULK_READ_PAGE_SIZE 0x10000 +-#define ALLOCATE_BULK_READ_PAGES 16 /* 16 * 65536 = 1Mb */ ++#define ALLOCATE_BULK_READ_PAGES 17 /* 16 * 65536 = 1Mb */ ++#define MAX_READ_PAGES 16 /* maximum that we will return to sane_read() */ + + /* Structure describing bulk read state, because bulk reads will be done in + * pages, but function caller uses its own buffer, whose size is certainly diff --git a/debian/patches/0190-Fix_scanimage_help.patch b/debian/patches/0190-Fix_scanimage_help.patch new file mode 100644 index 0000000..9d0901f --- /dev/null +++ b/debian/patches/0190-Fix_scanimage_help.patch @@ -0,0 +1,20 @@ +Description: Fix scanimage --help output +Author: Jörg Frings-Fürst <debian@jff.email> +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1094671 +Forwarded: https://gitlab.com/sane-project/backends/-/issues/795 +Last-Update: 2025-03-16 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/frontend/scanimage.c +=================================================================== +--- trunk.orig/frontend/scanimage.c ++++ trunk/frontend/scanimage.c +@@ -2372,7 +2372,7 @@ Parameters are separated by a blank from + %%n (newline)\n\ + -b, --batch[=FORMAT] working in batch mode, FORMAT is `out%%d.pnm' `out%%d.tif'\n\ + `out%%d.png' or `out%%d.jpg' by default depending on --format\n\ +- This option is incompatible with --output-file."); ++ This option is incompatible with --output-file.\n"); + printf ("\ + --batch-start=# page number to start naming files with\n\ + --batch-count=# how many pages to scan in batch mode\n\ diff --git a/debian/patches/0205-ftbfs_with_GCC-15.patch b/debian/patches/0205-ftbfs_with_GCC-15.patch new file mode 100644 index 0000000..54a7421 --- /dev/null +++ b/debian/patches/0205-ftbfs_with_GCC-15.patch @@ -0,0 +1,22 @@ +Description: Fix ftbfs with GCC-15 +Author: <name and email of author, optional> +Origin: https://gitlab.com/sane-project/backends/-/commit/f5736eb50c3be88428f7d629b20c5c514df85b82 +Bug: https://gitlab.com/sane-project/backends/-/issues/796 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1097841 +Last-Update: 2025-03-22 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/backend/sm3600.h +=================================================================== +--- trunk.orig/backend/sm3600.h ++++ trunk/backend/sm3600.h +@@ -77,7 +77,8 @@ Start: 2.4.2001 + + /* ====================================================================== */ + +-typedef enum { false, true } TBool; ++#include <stdbool.h> ++typedef bool TBool; + + typedef SANE_Status TState; + diff --git a/debian/patches/series b/debian/patches/series index 93fa125..6e62f3f 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -13,3 +13,6 @@ 0200-disable-check-equal-stderr.patch 0610-fix_groff_font_warnings.patch 0180-Escl_force_idle_status.patch +0185-fix_memory.patch +0190-Fix_scanimage_help.patch +0205-ftbfs_with_GCC-15.patch |