We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b62c902 commit 25eb00cCopy full SHA for 25eb00c
libaudiofile/modules/IMA.cpp
@@ -169,7 +169,7 @@ int IMA::decodeBlockWAVE(const uint8_t *encoded, int16_t *decoded)
169
if (encoded[1] & 0x80)
170
m_adpcmState[c].previousValue -= 0x10000;
171
172
- m_adpcmState[c].index = encoded[2];
+ m_adpcmState[c].index = clamp(encoded[2], 0, 88);
173
174
*decoded++ = m_adpcmState[c].previousValue;
175
@@ -210,7 +210,7 @@ int IMA::decodeBlockQT(const uint8_t *encoded, int16_t *decoded)
210
predictor -= 0x10000;
211
212
state.previousValue = clamp(predictor, MIN_INT16, MAX_INT16);
213
- state.index = encoded[1] & 0x7f;
+ state.index = clamp(encoded[1] & 0x7f, 0, 88);
214
encoded += 2;
215
216
for (int n=0; n<m_framesPerPacket; n+=2)
0 commit comments