kopia lustrzana https://gitlab.com/sane-project/backends
genesys: fix for computation of total file size exceeding unsigned
Large scans that exceed 32-bits need cast to allow 64-bit size.merge-requests/706/head
rodzic
4091619e07
commit
41866df6e1
|
@ -744,7 +744,7 @@ void CommandSetGl124::init_regs_for_scan_session(Genesys_Device* dev, const Gene
|
||||||
dev->session = session;
|
dev->session = session;
|
||||||
|
|
||||||
dev->total_bytes_read = 0;
|
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__,
|
DBG(DBG_info, "%s: total bytes to send to frontend = %zu\n", __func__,
|
||||||
dev->total_bytes_to_read);
|
dev->total_bytes_to_read);
|
||||||
|
|
|
@ -818,7 +818,8 @@ void CommandSetGl646::init_regs_for_scan_session(Genesys_Device* dev, const Gene
|
||||||
dev->session = session;
|
dev->session = session;
|
||||||
|
|
||||||
dev->total_bytes_read = 0;
|
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 */
|
/* select color filter based on settings */
|
||||||
regs->find_reg(0x04).value &= ~REG_0x04_FILTER;
|
regs->find_reg(0x04).value &= ~REG_0x04_FILTER;
|
||||||
|
|
|
@ -978,7 +978,7 @@ dummy \ scanned lines
|
||||||
dev->session = session;
|
dev->session = session;
|
||||||
|
|
||||||
dev->total_bytes_read = 0;
|
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) {
|
if (session.use_host_side_gray) {
|
||||||
dev->total_bytes_to_read /= 3;
|
dev->total_bytes_to_read /= 3;
|
||||||
}
|
}
|
||||||
|
|
|
@ -569,7 +569,7 @@ void CommandSetGl842::init_regs_for_scan_session(Genesys_Device* dev, const Gene
|
||||||
dev->session = session;
|
dev->session = session;
|
||||||
|
|
||||||
dev->total_bytes_read = 0;
|
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,
|
ScanSession CommandSetGl842::calculate_scan_session(const Genesys_Device* dev,
|
||||||
|
|
|
@ -1042,7 +1042,7 @@ void CommandSetGl843::init_regs_for_scan_session(Genesys_Device* dev, const Gene
|
||||||
dev->session = session;
|
dev->session = session;
|
||||||
|
|
||||||
dev->total_bytes_read = 0;
|
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);
|
DBG(DBG_info, "%s: total bytes to send = %zu\n", __func__, dev->total_bytes_to_read);
|
||||||
}
|
}
|
||||||
|
|
|
@ -659,7 +659,7 @@ void CommandSetGl846::init_regs_for_scan_session(Genesys_Device* dev, const Gene
|
||||||
dev->session = session;
|
dev->session = session;
|
||||||
|
|
||||||
dev->total_bytes_read = 0;
|
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);
|
DBG(DBG_info, "%s: total bytes to send = %zu\n", __func__, dev->total_bytes_to_read);
|
||||||
}
|
}
|
||||||
|
|
|
@ -625,7 +625,7 @@ void CommandSetGl847::init_regs_for_scan_session(Genesys_Device* dev, const Gene
|
||||||
dev->session = session;
|
dev->session = session;
|
||||||
|
|
||||||
dev->total_bytes_read = 0;
|
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);
|
DBG(DBG_info, "%s: total bytes to send = %zu\n", __func__, dev->total_bytes_to_read);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue