This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: dvb-sat: fix rangeswitch logic
Author:  Mauro Carvalho Chehab <mche...@osg.samsung.com>
Date:    Mon Feb 13 07:33:21 2017 -0200

There are two bugs at the rangeswitch logic:

1) the logic there that checks if the frequency doesn't
   match may cause it to go past array;

2) rangeswitch == 0 means that there's no range switch for
   that LO. On such case, it should not increment the
   LO index.

Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>

 lib/libdvbv5/dvb-sat.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=0fa862430ecdcaef9d69b681b17026f0765f185b
diff --git a/lib/libdvbv5/dvb-sat.c b/lib/libdvbv5/dvb-sat.c
index ef63ec96dbf5..79008e2fba7a 100644
--- a/lib/libdvbv5/dvb-sat.c
+++ b/lib/libdvbv5/dvb-sat.c
@@ -611,8 +611,10 @@ static int dvb_sat_get_freq(struct dvb_v5_fe_parms *p, 
uint16_t *t)
                for (j = 0; j < ARRAY_SIZE(lnb->freqrange) && 
lnb->freqrange[j].low; j++) {
                        if (freq < lnb->freqrange[j].low * 1000 || freq > 
lnb->freqrange[j].high * 1000)
                                continue;
-                       if (freq > lnb->freqrange[j].rangeswitch * 1000)
-                               j++;
+                       if (lnb->freqrange[j].rangeswitch && freq > 
lnb->freqrange[j].rangeswitch * 1000) {
+                               if (j + 1 < ARRAY_SIZE(lnb->freqrange) && 
lnb->freqrange[j + 1].low)
+                                       j++;
+                       }
 
                        /* Sets DiSEqC to high_band if not low band */
                        if (j)

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to