tuner_r820t: check if Nint is within allowed range

Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
Steve Markgraf 2012-10-26 19:22:52 +02:00
parent 105e77c5d9
commit c179f860d5

View File

@ -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;