]> git.ipfire.org Git - thirdparty/asterisk.git/commit
media: Fix crash when determining sample count of a frame during shutdown.
authorAsterisk Autobuilder <asteriskteam@digium.com>
Fri, 19 Dec 2014 21:11:17 +0000 (21:11 +0000)
committerAsterisk Autobuilder <asteriskteam@digium.com>
Fri, 19 Dec 2014 21:11:17 +0000 (21:11 +0000)
commitab4d51c70c176d0a4f2f71465e2becf446c50f86
treee25f7cf2f0ebec94dd00fb903a0cc239f8d00c05
parent213b9452a35326eb059dbb21c29c4d8bd489bfdb
media: Fix crash when determining sample count of a frame during shutdown.

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.

ASTERISK-24604 #close
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/4260/
........

Merged revisions 429497 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/format.h
main/codec.c
main/format.c