History

lavc/lpc: do not explode when windowing a 1-length array

Divided by 0.

Lynne committed 4 years ago

Commit cc367a91 parent e601ec31 file · +5 −0Browse files

Unified · Split

libavcodec/lpc.c+5−0
@@ -38,6 +38,11 @@ static void lpc_apply_welch_window_c(const int32_t *data, int len, · 37 unmodified lines
38 double w;38 double w;
39 double c;39 double c;
40 40
41 if (len == 1) {
42 w_data[0] = 0.0;
43 return;
44 }
45
41 n2 = (len >> 1);46 n2 = (len >> 1);
42 c = 2.0 / (len - 1.0);47 c = 2.0 / (len - 1.0);
43 48

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t