diff options
author | Max Kellermann <max@duempel.org> | 2014-08-31 14:00:09 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-31 14:00:09 +0200 |
commit | af260b5a64b038c61d987d9ca7e3a3e96c656cde (patch) | |
tree | d6477ed8d97b7837c213e30f012cdcbaef0ba93a /src/output/AlsaOutputPlugin.cxx | |
parent | 4efa96df218cb5cf4bec885d9246c15ecb2f07e0 (diff) | |
download | mpd-af260b5a64b038c61d987d9ca7e3a3e96c656cde.tar.gz mpd-af260b5a64b038c61d987d9ca7e3a3e96c656cde.tar.xz mpd-af260b5a64b038c61d987d9ca7e3a3e96c656cde.zip |
output/{alsa,oss}: add assertions
Diffstat (limited to '')
-rw-r--r-- | src/output/AlsaOutputPlugin.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/output/AlsaOutputPlugin.cxx b/src/output/AlsaOutputPlugin.cxx index 6668c920f..76eea5bd6 100644 --- a/src/output/AlsaOutputPlugin.cxx +++ b/src/output/AlsaOutputPlugin.cxx @@ -802,6 +802,7 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size, { AlsaOutput *ad = (AlsaOutput *)ao; + assert(size > 0); assert(size % ad->in_frame_size == 0); if (ad->must_prepare) { @@ -819,6 +820,7 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size, assert(size % ad->out_frame_size == 0); size /= ad->out_frame_size; + assert(size > 0); while (true) { snd_pcm_sframes_t ret = ad->writei(ad->pcm, chunk, size); |