Blame audiofile-0.3.6-pull44.patch
|
Michael Schwendt |
c604cf |
diff -Nur audiofile-0.3.6/libaudiofile/modules/BlockCodec.cpp audiofile-0.3.6-pull44/libaudiofile/modules/BlockCodec.cpp
|
|
Michael Schwendt |
c604cf |
--- audiofile-0.3.6/libaudiofile/modules/BlockCodec.cpp 2013-03-06 06:30:03.000000000 +0100
|
|
Michael Schwendt |
c604cf |
+++ audiofile-0.3.6-pull44/libaudiofile/modules/BlockCodec.cpp 2017-03-09 10:21:18.000000000 +0100
|
|
Michael Schwendt |
c604cf |
@@ -47,7 +47,7 @@
|
|
Michael Schwendt |
c604cf |
|
|
Michael Schwendt |
c604cf |
// Read the compressed data.
|
|
Michael Schwendt |
c604cf |
ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount);
|
|
Michael Schwendt |
c604cf |
- int blocksRead = bytesRead >= 0 ? bytesRead / m_bytesPerPacket : 0;
|
|
Michael Schwendt |
c604cf |
+ int blocksRead = (bytesRead >= 0 && m_bytesPerPacket > 0) ? bytesRead / m_bytesPerPacket : 0;
|
|
Michael Schwendt |
c604cf |
|
|
Michael Schwendt |
c604cf |
// Decompress into m_outChunk.
|
|
Michael Schwendt |
c604cf |
for (int i=0; i
|
|
Michael Schwendt |
c604cf |
diff -Nur audiofile-0.3.6/libaudiofile/WAVE.cpp audiofile-0.3.6-pull44/libaudiofile/WAVE.cpp
|
|
Michael Schwendt |
c604cf |
--- audiofile-0.3.6/libaudiofile/WAVE.cpp 2013-03-06 06:30:03.000000000 +0100
|
|
Michael Schwendt |
c604cf |
+++ audiofile-0.3.6-pull44/libaudiofile/WAVE.cpp 2017-03-09 10:21:18.000000000 +0100
|
|
Michael Schwendt |
c604cf |
@@ -326,6 +326,7 @@
|
|
Michael Schwendt |
c604cf |
{
|
|
Michael Schwendt |
c604cf |
_af_error(AF_BAD_NOT_IMPLEMENTED,
|
|
Michael Schwendt |
c604cf |
"IMA ADPCM compression supports only 4 bits per sample");
|
|
Michael Schwendt |
c604cf |
+ return AF_FAIL;
|
|
Michael Schwendt |
c604cf |
}
|
|
Michael Schwendt |
c604cf |
|
|
Michael Schwendt |
c604cf |
int bytesPerBlock = (samplesPerBlock + 14) / 8 * 4 * channelCount;
|
|
Michael Schwendt |
c604cf |
@@ -333,6 +334,7 @@
|
|
Michael Schwendt |
c604cf |
{
|
|
Michael Schwendt |
c604cf |
_af_error(AF_BAD_CODEC_CONFIG,
|
|
Michael Schwendt |
c604cf |
"Invalid samples per block for IMA ADPCM compression");
|
|
Michael Schwendt |
c604cf |
+ return AF_FAIL;
|
|
Michael Schwendt |
c604cf |
}
|
|
Michael Schwendt |
c604cf |
|
|
Michael Schwendt |
c604cf |
track->f.sampleWidth = 16;
|