[asterisk-dev] [Code Review] Crash in audiohook_write_list

Tilghman Lesher tlesher at digium.com
Fri Apr 23 10:19:12 CDT 2010


On Friday 23 April 2010 05:18:14 Kaloyan Kovachev wrote:
> On Thu, 22 Apr 2010 20:56:41 -0000, "David Vossel" wrote:
> > In audio_audiohook_write_list(), middle_frame represents the translated
> > SLINEAR version of the input frame (that is if the input frame was not
> > already SLINEAR to begin with, If that is the case, middle_frame is the
> > input frame)
>
> This it the crash mentioned in note 113581 for issue 14621
> https://issues.asterisk.org/view.php?id=14621
> Why not just check that there is a frame before proceeding with the
> callback? This way in case of failure no manipulations will be made after
> an error and the original frame will be passed unmodified.

Because the manipulate callback doesn't produce a new frame; it merely
changes the audio in the frame passed.  The return value is what indicates
whether the audio in the frame was successfully changed or not.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list