Fix possible out-of-bounds-read.

This commit is contained in:
Fabian Eckermann 2021-10-26 16:12:18 +02:00 committed by Fabian Eckermann
parent 3e9590fd13
commit f539851128
1 changed files with 5 additions and 2 deletions

View File

@ -171,9 +171,12 @@ static float get_snr_dB(uint32_t L)
if (isnormal(snr_dB) && L < 4) { if (isnormal(snr_dB) && L < 4) {
return snr_dB; return snr_dB;
} else if (L < 4) {
return snr_table_dB[L];
} else {
ERROR("L >= 4\n");
return 0.0f;
} }
return snr_table_dB[L];
} }
static int test_case1() static int test_case1()