diff --git a/platform/mipi_dsi/mipi_tx_hi35xx.c b/platform/mipi_dsi/mipi_tx_hi35xx.c index b72caf07a4a0982a9d900259f3f283f94532a40d..ce99eb4f587ce5e442d41a376f34f19d0971937d 100644 --- a/platform/mipi_dsi/mipi_tx_hi35xx.c +++ b/platform/mipi_dsi/mipi_tx_hi35xx.c @@ -37,6 +37,7 @@ extern "C" { #endif /* End of #ifdef __cplusplus */ #define HDF_LOG_TAG mipi_tx_hi35xx +#define INT_MAX_VALUE 0x7fffffff volatile MipiTxRegsTypeTag *g_mipiTxRegsVa = NULL; unsigned int g_mipiTxIrqNum = MIPI_TX_IRQ; @@ -143,6 +144,10 @@ static void MipiTxDrvGetPhyPllSet1Set5(unsigned int phyDataRate, } else { pllRef = 1; } + if ((dataRateClk * pllRef) > INT_MAX_VALUE) { + HDF_LOGE("%s: exceeds the maximum value of type int.", __func__); + return; + } if ((dataRateClk * pllRef) % 2) { /* 2: pll */ *pllSet1 = 0x10; *pllSet5 = (dataRateClk * pllRef - 1) / 2; /* 2: pllRef sel */