diff -Nur audiofile-0.3.6/libaudiofile/modules/BlockCodec.cpp audiofile-0.3.6-pull44/libaudiofile/modules/BlockCodec.cpp --- audiofile-0.3.6/libaudiofile/modules/BlockCodec.cpp 2013-03-06 06:30:03.000000000 +0100 +++ audiofile-0.3.6-pull44/libaudiofile/modules/BlockCodec.cpp 2017-03-09 10:21:18.000000000 +0100 @@ -47,7 +47,7 @@ // Read the compressed data. ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount); - int blocksRead = bytesRead >= 0 ? bytesRead / m_bytesPerPacket : 0; + int blocksRead = (bytesRead >= 0 && m_bytesPerPacket > 0) ? bytesRead / m_bytesPerPacket : 0; // Decompress into m_outChunk. for (int i=0; if.sampleWidth = 16;