aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/OssOutputPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-31 14:00:09 +0200
committerMax Kellermann <max@duempel.org>2014-08-31 14:00:09 +0200
commitaf260b5a64b038c61d987d9ca7e3a3e96c656cde (patch)
treed6477ed8d97b7837c213e30f012cdcbaef0ba93a /src/output/OssOutputPlugin.cxx
parent4efa96df218cb5cf4bec885d9246c15ecb2f07e0 (diff)
downloadmpd-af260b5a64b038c61d987d9ca7e3a3e96c656cde.tar.gz
mpd-af260b5a64b038c61d987d9ca7e3a3e96c656cde.tar.xz
mpd-af260b5a64b038c61d987d9ca7e3a3e96c656cde.zip
output/{alsa,oss}: add assertions
Diffstat (limited to 'src/output/OssOutputPlugin.cxx')
-rw-r--r--src/output/OssOutputPlugin.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/output/OssOutputPlugin.cxx b/src/output/OssOutputPlugin.cxx
index 68f2a38aa..cdde6d562 100644
--- a/src/output/OssOutputPlugin.cxx
+++ b/src/output/OssOutputPlugin.cxx
@@ -727,6 +727,8 @@ oss_output_play(struct audio_output *ao, const void *chunk, size_t size,
OssOutput *od = (OssOutput *)ao;
ssize_t ret;
+ assert(size > 0);
+
/* reopen the device since it was closed by dropBufferedAudio */
if (od->fd < 0 && !oss_reopen(od, error))
return 0;
@@ -735,6 +737,8 @@ oss_output_play(struct audio_output *ao, const void *chunk, size_t size,
chunk = od->pcm_export->Export(chunk, size, size);
#endif
+ assert(size > 0);
+
while (true) {
ret = write(od->fd, chunk, size);
if (ret > 0) {