cmusphinx / sphinx4

Pure Java speech recognition library
cmusphinx.sourceforge.net
Other
1.4k stars 586 forks source link

Infinite for loop bug #99

Closed vlad-coteanu-uipath closed 4 years ago

vlad-coteanu-uipath commented 4 years ago

https://github.com/cmusphinx/sphinx4/blob/32df364ce3d9688c13a524981898931335d688e5/sphinx4-core/src/main/java/edu/cmu/sphinx/frontend/util/WavWriter.java#L221

Old: for (int j = bytesPerValue - 1; j >= 0; j++) { byteArray[byteArInd + j] = (byte) (val & 0xff); val = val >> 8; }

Suggested: for (int j = bytesPerValue - 1; j >= 0; j--) { byteArray[byteArInd + j] = (byte) (val & 0xff); val = val >> 8; }

nshmyrev commented 4 years ago

Fixed now with a pull request #100