]> git.ipfire.org Git - thirdparty/asterisk.git/commit
codec.c: Defensively check the returned samples.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 25 Oct 2017 19:38:19 +0000 (14:38 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 26 Oct 2017 16:48:23 +0000 (11:48 -0500)
commitca7f3d297b53785ba3b5282a569ea8add9717c8b
tree77f40650715a253cc5c944dac8193faf94297a07
parent28368b355344ea1001ab2594905109e1090c0704
codec.c: Defensively check the returned samples.

Earlier versions of the codec_opus samples_count callback can return
negative error values on undecodable frames.  This resulted in a divide by
zero exception.

* Added a defensive check in ast_codec_samples_count() for a "negative"
samples count return value.  Log the event and set the count to zero.

ASTERISK-27194

Change-Id: Icf69350307ecbbc80a3d74de46af9bd80ea17819
main/codec.c