summaryrefslogtreecommitdiff
path: root/debian/patches/0195-genesys_fix_total_file_size_exceeding.patch
blob: 4b9524119ee7910a9b49b16168accd7a44258cb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Description: Fix out off memory on high resultions
Origin: upstream, https://gitlab.com/sane-project/backends/-/merge_requests/697
Bug: https://gitlab.com/sane-project/backends/-/issues/580
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=942176
Forwarded: no
Last-Update: 2022-03-27
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: trunk/backend/genesys/gl124.cpp
===================================================================
--- trunk.orig/backend/genesys/gl124.cpp
+++ trunk/backend/genesys/gl124.cpp
@@ -745,7 +745,7 @@ void CommandSetGl124::init_regs_for_scan
     dev->session = session;
 
     dev->total_bytes_read = 0;
-    dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
+    dev->total_bytes_to_read = (size_t)session.output_line_bytes_requested * (size_t)session.params.lines;
 
     DBG(DBG_info, "%s: total bytes to send to frontend = %zu\n", __func__,
         dev->total_bytes_to_read);
Index: trunk/backend/genesys/gl646.cpp
===================================================================
--- trunk.orig/backend/genesys/gl646.cpp
+++ trunk/backend/genesys/gl646.cpp
@@ -817,7 +817,8 @@ void CommandSetGl646::init_regs_for_scan
     dev->session = session;
 
     dev->total_bytes_read = 0;
-    dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
+    dev->total_bytes_to_read = (size_t) session.output_line_bytes_requested
+          * (size_t) session.params.lines;
 
     /* select color filter based on settings */
     regs->find_reg(0x04).value &= ~REG_0x04_FILTER;
Index: trunk/backend/genesys/gl841.cpp
===================================================================
--- trunk.orig/backend/genesys/gl841.cpp
+++ trunk/backend/genesys/gl841.cpp
@@ -920,7 +920,7 @@ dummy \ scanned lines
     dev->session = session;
 
     dev->total_bytes_read = 0;
-    dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
+    dev->total_bytes_to_read = (size_t)session.output_line_bytes_requested * (size_t)session.params.lines;
     if (session.use_host_side_gray) {
         dev->total_bytes_to_read /= 3;
     }
Index: trunk/backend/genesys/gl842.cpp
===================================================================
--- trunk.orig/backend/genesys/gl842.cpp
+++ trunk/backend/genesys/gl842.cpp
@@ -568,7 +568,7 @@ void CommandSetGl842::init_regs_for_scan
     dev->session = session;
 
     dev->total_bytes_read = 0;
-    dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
+    dev->total_bytes_to_read = (size_t)session.output_line_bytes_requested * (size_t)session.params.lines;
 }
 
 ScanSession CommandSetGl842::calculate_scan_session(const Genesys_Device* dev,
Index: trunk/backend/genesys/gl843.cpp
===================================================================
--- trunk.orig/backend/genesys/gl843.cpp
+++ trunk/backend/genesys/gl843.cpp
@@ -1041,7 +1041,7 @@ void CommandSetGl843::init_regs_for_scan
     dev->session = session;
 
   dev->total_bytes_read = 0;
-    dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
+    dev->total_bytes_to_read = (size_t)session.output_line_bytes_requested * (size_t)session.params.lines;
 
     DBG(DBG_info, "%s: total bytes to send = %zu\n", __func__, dev->total_bytes_to_read);
 }
Index: trunk/backend/genesys/gl846.cpp
===================================================================
--- trunk.orig/backend/genesys/gl846.cpp
+++ trunk/backend/genesys/gl846.cpp
@@ -658,7 +658,7 @@ void CommandSetGl846::init_regs_for_scan
     dev->session = session;
 
     dev->total_bytes_read = 0;
-    dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
+    dev->total_bytes_to_read = (size_t)session.output_line_bytes_requested * (size_t)session.params.lines;
 
     DBG(DBG_info, "%s: total bytes to send = %zu\n", __func__, dev->total_bytes_to_read);
 }
Index: trunk/backend/genesys/gl847.cpp
===================================================================
--- trunk.orig/backend/genesys/gl847.cpp
+++ trunk/backend/genesys/gl847.cpp
@@ -624,7 +624,7 @@ void CommandSetGl847::init_regs_for_scan
     dev->session = session;
 
     dev->total_bytes_read = 0;
-    dev->total_bytes_to_read = session.output_line_bytes_requested * session.params.lines;
+    dev->total_bytes_to_read = (size_t)session.output_line_bytes_requested * (size_t)session.params.lines;
 
     DBG(DBG_info, "%s: total bytes to send = %zu\n", __func__, dev->total_bytes_to_read);
 }