mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 11:11:05 +00:00
channels: Don't dereference NULL pointer
Check result of ast_translator_build_path against NULL before dereferencing. ASTERISK-29091 Change-Id: Ia3538ea190bd371f70c9dd49984b021765691b29
This commit is contained in:
committed by
George Joseph
parent
4499fbc819
commit
08ccfd4588
@@ -5709,11 +5709,15 @@ static int set_format(struct ast_channel *chan, struct ast_format_cap *cap_set,
|
||||
if (!direction) {
|
||||
/* reading */
|
||||
trans_pvt = ast_translator_build_path(best_set_fmt, best_native_fmt);
|
||||
trans_pvt->interleaved_stereo = 0;
|
||||
if (trans_pvt) {
|
||||
trans_pvt->interleaved_stereo = 0;
|
||||
}
|
||||
} else {
|
||||
/* writing */
|
||||
trans_pvt = ast_translator_build_path(best_native_fmt, best_set_fmt);
|
||||
trans_pvt->interleaved_stereo = interleaved_stereo;
|
||||
if (trans_pvt) {
|
||||
trans_pvt->interleaved_stereo = interleaved_stereo;
|
||||
}
|
||||
}
|
||||
access->set_trans(chan, trans_pvt);
|
||||
res = trans_pvt ? 0 : -1;
|
||||
|
Reference in New Issue
Block a user