aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/oss/pcm_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/oss/pcm_plugin.c')
-rw-r--r--sound/core/oss/pcm_plugin.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
index cadc93792868..85a56af104bd 100644
--- a/sound/core/oss/pcm_plugin.c
+++ b/sound/core/oss/pcm_plugin.c
@@ -592,18 +592,26 @@ snd_pcm_sframes_t snd_pcm_plug_write_transfer(struct snd_pcm_substream *plug, st
592 snd_pcm_sframes_t frames = size; 592 snd_pcm_sframes_t frames = size;
593 593
594 plugin = snd_pcm_plug_first(plug); 594 plugin = snd_pcm_plug_first(plug);
595 while (plugin && frames > 0) { 595 while (plugin) {
596 if (frames <= 0)
597 return frames;
596 if ((next = plugin->next) != NULL) { 598 if ((next = plugin->next) != NULL) {
597 snd_pcm_sframes_t frames1 = frames; 599 snd_pcm_sframes_t frames1 = frames;
598 if (plugin->dst_frames) 600 if (plugin->dst_frames) {
599 frames1 = plugin->dst_frames(plugin, frames); 601 frames1 = plugin->dst_frames(plugin, frames);
602 if (frames1 <= 0)
603 return frames1;
604 }
600 if ((err = next->client_channels(next, frames1, &dst_channels)) < 0) { 605 if ((err = next->client_channels(next, frames1, &dst_channels)) < 0) {
601 return err; 606 return err;
602 } 607 }
603 if (err != frames1) { 608 if (err != frames1) {
604 frames = err; 609 frames = err;
605 if (plugin->src_frames) 610 if (plugin->src_frames) {
606 frames = plugin->src_frames(plugin, frames1); 611 frames = plugin->src_frames(plugin, frames1);
612 if (frames <= 0)
613 return frames;
614 }
607 } 615 }
608 } else 616 } else
609 dst_channels = NULL; 617 dst_channels = NULL;