summaryrefslogtreecommitdiffstats
path: root/src/ModPlugin.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-03-16 11:29:14 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-03-16 11:29:14 +0100
commit5e75a8406ed47d8c576bba77a3bb68a5092cd558 (patch)
treedd9fe52ce7d1c831a5f228768c4ac64709106f65 /src/ModPlugin.cpp
parent50fd88f82b8dc2fb7d5f188baed03300eebdc099 (diff)
downloaddabmod-5e75a8406ed47d8c576bba77a3bb68a5092cd558.tar.gz
dabmod-5e75a8406ed47d8c576bba77a3bb68a5092cd558.tar.bz2
dabmod-5e75a8406ed47d8c576bba77a3bb68a5092cd558.zip
Fix invalid call of memset with length 0
Diffstat (limited to 'src/ModPlugin.cpp')
-rw-r--r--src/ModPlugin.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ModPlugin.cpp b/src/ModPlugin.cpp
index f907ba8..4291a44 100644
--- a/src/ModPlugin.cpp
+++ b/src/ModPlugin.cpp
@@ -104,7 +104,9 @@ int PipelinedModCodec::process(Buffer* dataIn, Buffer* dataOut)
}
else {
dataOut->setLength(dataIn->getLength());
- memset(dataOut->getData(), 0, dataOut->getLength());
+ if (dataOut->getLength() > 0) {
+ memset(dataOut->getData(), 0, dataOut->getLength());
+ }
m_ready_to_output_data = true;
}