Blame SOURCES/audiofile-0.3.6-pull44.patch

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