[asterisk-dev] [Code Review] 4260: media: Fix crash when determining sample count of a frame during shutdown

Joshua Colp reviewboard at asterisk.org
Fri Dec 12 10:57:32 CST 2014


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

(Updated Dec. 12, 2014, 10:57 a.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
-------

Committed in revision 429497


Bugs: ASTERISK-24604
    https://issues.asterisk.org/jira/browse/ASTERISK-24604


Repository: Asterisk


Description
-------

When shutting down Asterisk the codecs are cleaned up. As a result anything attempting to get a codec based on ID or details will find that no codec exists. This currently occurs when determining the sample count of a frame. This code did not take this situation into account.

This change fixes this by getting the codec directly from the format and eliminates the lookup. This is both faster and also provides a guarantee that the codec will exist and will be valid.


Diffs
-----

  /branches/13/main/format.c 429406 
  /branches/13/main/codec.c 429406 
  /branches/13/include/asterisk/format.h 429406 

Diff: https://reviewboard.asterisk.org/r/4260/diff/


Testing
-------

Ran some normal calls to ensure no regression. Also did some restarts/shutdowns but due to the raceyness of this it is generally hard to reproduce for me.


Thanks,

Joshua Colp

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


More information about the asterisk-dev mailing list