Package: espeak-ng / 1.49.2+dfsg-8

out_of_bound Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
https://github.com/espeak-ng/espeak-ng/pull/478
---
 src/libespeak-ng/klatt.c   |    2 +-
 src/libespeak-ng/wavegen.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

--- a/src/libespeak-ng/wavegen.c
+++ b/src/libespeak-ng/wavegen.c
@@ -883,7 +883,7 @@ int Wavegen()
 		if (echo_head >= N_ECHO_BUF)
 			echo_head = 0;
 
-		if (out_ptr >= out_end)
+		if (out_ptr + 2 > out_end)
 			return 1;
 	}
 }
@@ -916,7 +916,7 @@ static int PlaySilence(int length, int r
 		if (echo_head >= N_ECHO_BUF)
 			echo_head = 0;
 
-		if (out_ptr >= out_end)
+		if (out_ptr + 2 > out_end)
 			return 1;
 	}
 	return 0;
@@ -969,7 +969,7 @@ static int PlayWave(int length, int resu
 		if (echo_head >= N_ECHO_BUF)
 			echo_head = 0;
 
-		if (out_ptr >= out_end)
+		if (out_ptr + 2 > out_end)
 			return 1;
 	}
 	return 0;
--- a/src/libespeak-ng/klatt.c
+++ b/src/libespeak-ng/klatt.c
@@ -422,7 +422,7 @@ static int parwave(klatt_frame_ptr frame
 			echo_head = 0;
 
 		sample_count++;
-		if (out_ptr >= out_end)
+		if (out_ptr + 2 > out_end)
 			return 1;
 	}
 	return 0;