[asterisk-dev] [Code Review] 3625: media_formats: Update most of core (main/*.c)

Corey Farrell reviewboard at asterisk.org
Thu Jun 19 15:18:51 CDT 2014



> On June 19, 2014, 3:56 p.m., Matt Jordan wrote:
> > /team/group/media_formats-reviewed/main/core_unreal.c, line 900
> > <https://reviewboard.asterisk.org/r/3625/diff/1/?file=59756#file59756line900>
> >
> >     Given the number of off nominal paths *and* the fact that this will be de-ref'd on the nominal path, you may want to consider using RAII_VAR here.
> >     
> >     It has been used inappropriately in other places, but this one may make some sense.

Agreed.


> On June 19, 2014, 3:56 p.m., Matt Jordan wrote:
> > /team/group/media_formats-reviewed/main/core_unreal.c, lines 935-936
> > <https://reviewboard.asterisk.org/r/3625/diff/1/?file=59756#file59756line935>
> >
> >     This is one of those weird-isms about core_unreal:
> >     
> >     While its pvt is ao2 ref counted, the channel core does not expect a channel's pvt to be a ref counted object. Hence, if you destruct a channel and that channel still has a pvt, it will attempt to ast_free the pvt.
> >     
> >     Since the channel was just allocated here, that means this will destroy the channel and cause a memory corruption. (Yup, there's a bunch of places where this happens in here - whoops)
> >     
> >     In the off nominal paths, make sure you call ast_channel_tech_pvt_set(owner, NULL) - or move the association of the owner/pvt later on in the code.

Rather than delay the association I decided to NULL it before ao2_ref(p, -1);

I added this NULL set to all error paths in ast_unreal_new_channels.


> On June 19, 2014, 3:56 p.m., Matt Jordan wrote:
> > /team/group/media_formats-reviewed/main/data.c, lines 3122-3126
> > <https://reviewboard.asterisk.org/r/3625/diff/1/?file=59757#file59757line3122>
> >
> >     Is/was fr_len used anywhere else?

fr_len is still referenced from res_rtp_asterisk in the call to ast_smoother_new().  It was previously set by format_list_add_static and the code that added celt/silk.


- Corey


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3625/#review12220
-----------------------------------------------------------


On June 19, 2014, 4:18 p.m., Corey Farrell wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3625/
> -----------------------------------------------------------
> 
> (Updated June 19, 2014, 4:18 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Updates to allow most of the Asterisk core to compile.  I've excluded main/channel.c, main/dsp.c and main/rtp_engine.c.  Changes to those files will be posted separate since I feel they are more complex and likely to have more error's.  If any of the files included in this review fit that description let me know and I will split them off.
> 
> This change does not include any replacement for calls to ast_format_is_slinear(), and adds it back to the header (but does not implement).  So ast_format_is_slinear hasn't been fixed, just deferred to become a link error.
> 
> The modifications to chan_phone are to allow what I believe to be a comparability function to be in the correct namespace to be implemented in format_compatibility.c.
> 
> 
> Diffs
> -----
> 
>   /team/group/media_formats-reviewed/main/stasis_channels.c 416235 
>   /team/group/media_formats-reviewed/main/sounds_index.c 416235 
>   /team/group/media_formats-reviewed/main/sorcery.c 416235 
>   /team/group/media_formats-reviewed/main/slinfactory.c 416235 
>   /team/group/media_formats-reviewed/main/media_index.c 416235 
>   /team/group/media_formats-reviewed/main/manager.c 416235 
>   /team/group/media_formats-reviewed/main/indications.c 416235 
>   /team/group/media_formats-reviewed/main/image.c 416235 
>   /team/group/media_formats-reviewed/main/frame.c 416235 
>   /team/group/media_formats-reviewed/main/format_pref.c 416235 
>   /team/group/media_formats-reviewed/main/format_compatibility.c 416235 
>   /team/group/media_formats-reviewed/main/format.c 416235 
>   /team/group/media_formats-reviewed/main/file.c 416235 
>   /team/group/media_formats-reviewed/main/dial.c 416235 
>   /team/group/media_formats-reviewed/main/data.c 416235 
>   /team/group/media_formats-reviewed/main/core_unreal.c 416235 
>   /team/group/media_formats-reviewed/main/core_local.c 416235 
>   /team/group/media_formats-reviewed/main/codec.c 416235 
>   /team/group/media_formats-reviewed/include/asterisk/slinfactory.h 416235 
>   /team/group/media_formats-reviewed/include/asterisk/rtp_engine.h 416235 
>   /team/group/media_formats-reviewed/include/asterisk/format_pref.h 416235 
>   /team/group/media_formats-reviewed/include/asterisk/format_compatibility.h 416235 
>   /team/group/media_formats-reviewed/include/asterisk/format_cache.h 416235 
>   /team/group/media_formats-reviewed/include/asterisk/format.h 416235 
>   /team/group/media_formats-reviewed/include/asterisk/file.h 416235 
>   /team/group/media_formats-reviewed/channels/chan_phone.c 416235 
> 
> Diff: https://reviewboard.asterisk.org/r/3625/diff/
> 
> 
> Testing
> -------
> 
> Compiled.
> 
> 
> Thanks,
> 
> Corey Farrell
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140619/a52f40ab/attachment-0001.html>


More information about the asterisk-dev mailing list