summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-06-17 21:04:52 +0200
committerMax Kellermann <max@musicpd.org>2019-06-17 21:07:30 +0200
commit79839db3a3b6819eb4d4d8408bc368bf1bc2618e (patch)
tree4d8cf2449dd346dd4686ae81f5b9ea41772a10c6 /src
parentd478bdda8e9762f9e3843d94da5c50e3124a61e0 (diff)
output/oss: return early if PcmExport::Export() returns empty array
This can happen if the DoP converter doesn't get enough source samples for one destination quad. This isn't a critical bug, because the OSS plugin doesn't support DoP yet, but it's good to be prepared.
Diffstat (limited to 'src')
-rw-r--r--src/output/plugins/OssOutputPlugin.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/output/plugins/OssOutputPlugin.cxx b/src/output/plugins/OssOutputPlugin.cxx
index 26e8ff2a9..77ec21bed 100644
--- a/src/output/plugins/OssOutputPlugin.cxx
+++ b/src/output/plugins/OssOutputPlugin.cxx
@@ -670,12 +670,13 @@ OssOutput::Play(const void *chunk, size_t size)
#ifdef AFMT_S24_PACKED
const auto e = pcm_export->Export({chunk, size});
+ if (e.empty())
+ return size;
+
chunk = e.data;
size = e.size;
#endif
- assert(size > 0);
-
while (true) {
ret = fd.Write(chunk, size);
if (ret > 0) {