patch-libaudiofile_modules_IMA_cpp 756 B

1234567891011121314151617181920
  1. --- audiofile-0.3.6.orig/libaudiofile/modules/IMA.cpp 2013-03-06 06:30:03.000000000 +0100
  2. +++ audiofile-0.3.6/libaudiofile/modules/IMA.cpp 2017-04-26 02:15:03.959745133 +0200
  3. @@ -169,7 +169,7 @@ int IMA::decodeBlockWAVE(const uint8_t *
  4. if (encoded[1] & 0x80)
  5. m_adpcmState[c].previousValue -= 0x10000;
  6. - m_adpcmState[c].index = encoded[2];
  7. + m_adpcmState[c].index = clamp(encoded[2], 0, 88);
  8. *decoded++ = m_adpcmState[c].previousValue;
  9. @@ -210,7 +210,7 @@ int IMA::decodeBlockQT(const uint8_t *en
  10. predictor -= 0x10000;
  11. state.previousValue = clamp(predictor, MIN_INT16, MAX_INT16);
  12. - state.index = encoded[1] & 0x7f;
  13. + state.index = clamp(encoded[1] & 0x7f, 0, 88);
  14. encoded += 2;
  15. for (int n=0; n<m_framesPerPacket; n+=2)