Merged revisions 8437 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Sun, 22 Jan 2006 17:53:14 +0000 (17:53 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sun, 22 Jan 2006 17:53:14 +0000 (17:53 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8437 | russell | 2006-01-22 12:47:13 -0500 (Sun, 22 Jan 2006) | 2 lines

fix MixMonitor crash (issue #6321, probably others)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8438 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c

index 51e171a..51c8937 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -3911,7 +3911,7 @@ static void copy_data_from_queue(struct ast_channel_spy_queue *queue, short *buf
                }
 
                tocopy = (f->samples > samples) ? samples : f->samples;
-               bytestocopy = ast_codec_get_len(queue->format, samples);
+               bytestocopy = ast_codec_get_len(queue->format, tocopy);
                memcpy(buf, f->data, bytestocopy);
                samples -= tocopy;
                buf += tocopy;