Prevent a 0 division when invalid frequency step is reported by dvb.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 26 Apr 2009 20:59:50 +0000 (22:59 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 28 Apr 2009 16:59:41 +0000 (18:59 +0200)
modules/access/dvb/linux_dvb.c

index ae8ed71..2654fd1 100644 (file)
@@ -414,7 +414,7 @@ static int ScanParametersDvbC( access_t *p_access, scan_parameter_t *p_scan )
     /* */
     p_scan->frequency.i_min = p_frontend->info.frequency_min;
     p_scan->frequency.i_max = p_frontend->info.frequency_max;
-    p_scan->frequency.i_step = p_frontend->info.frequency_stepsize;
+    p_scan->frequency.i_step = p_frontend->info.frequency_stepsize ?: 166667;
     p_scan->frequency.i_count = (p_scan->frequency.i_max-p_scan->frequency.i_min)/p_scan->frequency.i_step;
 
     /* */
@@ -436,7 +436,7 @@ static int ScanParametersDvbT( access_t *p_access, scan_parameter_t *p_scan )
     /* */
     p_scan->frequency.i_min = p_frontend->info.frequency_min;
     p_scan->frequency.i_max = p_frontend->info.frequency_max;
-    p_scan->frequency.i_step = p_frontend->info.frequency_stepsize;
+    p_scan->frequency.i_step = p_frontend->info.frequency_stepsize ?: 166667;
     p_scan->frequency.i_count = (p_scan->frequency.i_max-p_scan->frequency.i_min)/p_scan->frequency.i_step;
 
     /* */