Update of /cvsroot/alsa/alsa-kernel/core/oss
In directory sc8-pr-cvs1:/tmp/cvs-serv19268
Modified Files:
pcm_plugin.c pcm_plugin.h rate.c
Log Message:
Fixed the access beyond the sample buffer due to rounding problem
Index: pcm_plugin.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/oss/pcm_plugin.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- pcm_plugin.c 21 Jul 2003 13:28:27 -0000 1.12
+++ pcm_plugin.c 21 Jul 2003 14:12:04 -0000 1.13
@@ -96,6 +96,7 @@
c = plugin->buf_channels;
if (plugin->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) {
for (channel = 0; channel < format->channels; channel++, c++) {
+ c->frames = frames / format->channels;
c->enabled = 1;
c->wanted = 0;
c->area.addr = plugin->buf;
@@ -106,6 +107,7 @@
snd_assert((size % format->channels) == 0,);
size /= format->channels;
for (channel = 0; channel < format->channels; channel++, c++) {
+ c->frames = frames / format->channels;
c->enabled = 1;
c->wanted = 0;
c->area.addr = plugin->buf + (channel * size);
Index: pcm_plugin.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/oss/pcm_plugin.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- pcm_plugin.h 26 Jun 2002 02:02:49 -0000 1.3
+++ pcm_plugin.h 21 Jul 2003 14:12:05 -0000 1.4
@@ -106,6 +106,7 @@
typedef struct _snd_pcm_plugin_channel {
void *aptr; /* pointer to the allocated area */
snd_pcm_channel_area_t area;
+ snd_pcm_uframes_t frames; /* allocated frames */
unsigned int enabled:1; /* channel need to be processed */
unsigned int wanted:1; /* channel is wanted */
} snd_pcm_plugin_channel_t;
Index: rate.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/oss/rate.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- rate.c 12 Aug 2002 08:43:45 -0000 1.7
+++ rate.c 21 Jul 2003 14:12:05 -0000 1.8
@@ -318,6 +318,8 @@
#endif
dst_frames = rate_dst_frames(plugin, frames);
+ if (dst_frames > dst_channels[0].frames)
+ dst_frames = dst_channels[0].frames;
data = (rate_t *)plugin->extra_data;
data->func(plugin, src_channels, dst_channels, frames, dst_frames);
return dst_frames;
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog