From 71f68035b32dc90a5e5f5adbc55de5947bc350e4 Mon Sep 17 00:00:00 2001 From: Alessandro Zummo Date: Sat, 5 Feb 2011 18:13:24 +0100 Subject: [PATCH] epson2: try to avoid a division by zero --- backend/epson2-ops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/epson2-ops.c b/backend/epson2-ops.c index d180eb7fe..0b8a7ea5a 100644 --- a/backend/epson2-ops.c +++ b/backend/epson2-ops.c @@ -1342,6 +1342,9 @@ e2_init_parameters(Epson_Scanner * s) #endif } + if (s->params.bytes_per_line == 0) + return SANE_STATUS_INVAL; + /* * Calculate correction for line_distance in D1 scanner: * Start line_distance lines earlier and add line_distance lines at the end