Skip to content
Snippets Groups Projects
Commit 8f86c840 authored by Mark Spencer's avatar Mark Spencer
Browse files

Don't dereference consumed frame delivery.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent ef89a270
Branches
Tags
No related merge requests found
...@@ -137,6 +137,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f, ...@@ -137,6 +137,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
{ {
struct ast_trans_pvt *p; struct ast_trans_pvt *p;
struct ast_frame *out; struct ast_frame *out;
struct timeval delivery;
p = path; p = path;
/* Feed the first frame into the first translator */ /* Feed the first frame into the first translator */
p->step->framein(p->state, f); p->step->framein(p->state, f);
...@@ -179,6 +180,8 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f, ...@@ -179,6 +180,8 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
path->nextin.tv_sec++; path->nextin.tv_sec++;
} }
} }
delivery.tv_sec = f->delivery.tv_sec;
delivery.tv_usec = f->delivery.tv_usec;
if (consume) if (consume)
ast_frfree(f); ast_frfree(f);
while(p) { while(p) {
...@@ -191,7 +194,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f, ...@@ -191,7 +194,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
if (p->next) if (p->next)
p->next->step->framein(p->next->state, out); p->next->step->framein(p->next->state, out);
else { else {
if (f->delivery.tv_sec || f->delivery.tv_usec) { if (delivery.tv_sec || delivery.tv_usec) {
/* Use next predicted outgoing timestamp */ /* Use next predicted outgoing timestamp */
out->delivery.tv_sec = path->nextout.tv_sec; out->delivery.tv_sec = path->nextout.tv_sec;
out->delivery.tv_usec = path->nextout.tv_usec; out->delivery.tv_usec = path->nextout.tv_usec;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment