Merged revisions 37856 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Tue, 18 Jul 2006 00:43:57 +0000 (00:43 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 18 Jul 2006 00:43:57 +0000 (00:43 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r37856 | russell | 2006-07-17 20:41:47 -0400 (Mon, 17 Jul 2006) | 2 lines

don't crash if the frame has no data, but has a src

........

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

frame.c

diff --git a/frame.c b/frame.c
index c2db41b..62d69ed 100644 (file)
--- a/frame.c
+++ b/frame.c
@@ -392,7 +392,7 @@ struct ast_frame *ast_frdup(struct ast_frame *f)
                memcpy(out->data, f->data, out->datalen);       
        }
        if (srclen > 0) {
-               out->src = out->data + f->datalen;
+               out->src = buf + sizeof(*out) + AST_FRIENDLY_OFFSET + f->datalen;
                /* Must have space since we allocated for it */
                strcpy((char *)out->src, f->src);
        }