From: Jacek Konieczny Date: Wed, 6 Apr 2016 13:01:47 +0000 (+0200) Subject: frame.c: Copy the whole subclass in ast_frdup(). X-Git-Tag: 13.9.0-rc1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fchanges%2F39%2F2539%2F2;p=thirdparty%2Fasterisk.git frame.c: Copy the whole subclass in ast_frdup(). The problem is ast_frdup() does not copy whole frame.subclass for voice, video and image frames, only the format is copied. For video frames, the subclass structure contains the .frame_ending flag used to put the RTP marker where it needs to be. ASTERISK-25894 #close Change-Id: I812ca90e84ed5d4f473b997d0dd0d3c5a915fe33 --- diff --git a/main/frame.c b/main/frame.c index 64af882379..b5ab9853de 100644 --- a/main/frame.c +++ b/main/frame.c @@ -320,11 +320,10 @@ struct ast_frame *ast_frdup(const struct ast_frame *f) } out->frametype = f->frametype; + out->subclass = f->subclass; if ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_VIDEO) || (f->frametype == AST_FRAME_IMAGE)) { - out->subclass.format = ao2_bump(f->subclass.format); - } else { - memcpy(&out->subclass, &f->subclass, sizeof(out->subclass)); + ao2_bump(out->subclass.format); } out->datalen = f->datalen; out->samples = f->samples;