summaryrefslogtreecommitdiff
blob: cecb3d3fab84a1f101977f1687a3f6e804cf8839 (plain)
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
https://bugs.gentoo.org/532180

Avoid "jump to label crosses initialization" error.

 Move variable "buffer" into the while loop to avoid a compile error
 with g++ 4.9.0.

 Although earlier compiler versions did accept the code, jumping into the
 scope of an variable length array is not allowed:
 http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Variable-Length.html


--- a/src/mumble/OSS.cpp
+++ b/src/mumble/OSS.cpp
@@ -243,9 +243,9 @@ void OSSInput::run() {
 	eMicFormat = SampleShort;
 	initializeMixer();
 
-	short buffer[iMicLength];
-
 	while (bRunning) {
+		short buffer[iMicLength];
+
 		int len = static_cast<int>(iMicLength * iMicChannels * sizeof(short));
 		ssize_t l = read(fd, buffer, len);
 		if (l != len) {