aboutsummaryrefslogtreecommitdiffstats
path: root/main/slinfactory.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-01 16:50:37 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-01 16:50:37 +0000
commit193282c8dd4c2014a7be7f930774cd261867f8b2 (patch)
treeecc72e587dafd24c032dae802fdf781cad301062 /main/slinfactory.c
parenta0e43a7c18fbf4cdf5cfbdffbf46e5b1dbe359a5 (diff)
Merged revisions 112125 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r112125 | file | 2008-04-01 13:45:14 -0300 (Tue, 01 Apr 2008) | 5 lines Ensure that we do not exceed the hold's maximum size with a single frame. (closes issue #12047) Reported by: fabianoheringer Tested by: fabianoheringer ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@112126 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/slinfactory.c')
-rw-r--r--main/slinfactory.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/slinfactory.c b/main/slinfactory.c
index 6c1bdd6f9..af70399e6 100644
--- a/main/slinfactory.c
+++ b/main/slinfactory.c
@@ -172,6 +172,9 @@ int ast_slinfactory_read(struct ast_slinfactory *sf, short *buf, size_t samples)
memcpy(offset, frame_data, ineed * sizeof(*offset));
sofar += ineed;
frame_data += ineed;
+ if (remain > (AST_SLINFACTORY_MAX_HOLD - sf->holdlen)) {
+ remain = AST_SLINFACTORY_MAX_HOLD - sf->holdlen;
+ }
memcpy(sf->hold, frame_data, remain * sizeof(*offset));
sf->holdlen = remain;
}