From b0ce1da0b541a2967d3601f996af9805cff26738 Mon Sep 17 00:00:00 2001 From: Daniel Scheller Date: Sat, 24 Jun 2017 17:38:05 +0200 Subject: [PATCH] stv0910: Fix possible buffer overflow, fix nBCH table offset --- frontends/stv0910.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontends/stv0910.c b/frontends/stv0910.c index 5322eba..1663bbd 100644 --- a/frontends/stv0910.c +++ b/frontends/stv0910.c @@ -673,6 +673,7 @@ static int GetBitErrorRateS(struct stv *state, u32 *BERNumerator, static u32 DVBS2_nBCH(enum DVBS2_ModCod ModCod, enum DVBS2_FECType FECType) { static u32 nBCH[][2] = { + { 0, 0}, /* DUMMY_PLF */ {16200, 3240}, /* QPSK_1_4, */ {21600, 5400}, /* QPSK_1_3, */ {25920, 6480}, /* QPSK_2_5, */ @@ -705,7 +706,7 @@ static u32 DVBS2_nBCH(enum DVBS2_ModCod ModCod, enum DVBS2_FECType FECType) if (ModCod >= DVBS2_QPSK_1_4 && ModCod <= DVBS2_32APSK_9_10 && FECType <= DVBS2_16K) - return nBCH[FECType][ModCod]; + return nBCH[ModCod][FECType]; return 64800; }