From c179f860d5f8fed418be1fc4fc33d5ec2b504d0a Mon Sep 17 00:00:00 2001 From: Steve Markgraf Date: Fri, 26 Oct 2012 19:22:52 +0200 Subject: [PATCH] tuner_r820t: check if Nint is within allowed range Signed-off-by: Steve Markgraf --- src/tuner_r820t.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tuner_r820t.c b/src/tuner_r820t.c index 553fbbc..fd3188d 100644 --- a/src/tuner_r820t.c +++ b/src/tuner_r820t.c @@ -1473,6 +1473,11 @@ R828_ErrCode R828_PLL(void *pTuner, UINT32 LO_Freq, R828_Standard_Type R828_Stan else VCO_Fra = VCO_Fra; + if (Nint > 63) { + fprintf(stderr, "[R820T] No valid PLL values for %u Hz!\n", LO_Freq); + return RT_Fail; + } + //N & S Ni = (Nint - 13) / 4; Si = Nint - 4 *Ni - 13;