Always call IsOk() to ensure audio codec configuration is valid when negotiating.
We should avoid creating codecs with invalid parameters, since this can expose security issues. For many codecs the IsOk() method to check the codec config is only called in DCHECKs. This CL ensures IsOk() is always called, also in non-debug builds. Bug: chromium:1265806 Change-Id: Ibd3c6c65d3bb547cd2603e11808ac40ac693a8b1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238801 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Ivo Creusen <ivoc@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35422}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
789a0f361f
commit
deb1b1bc70
@ -33,6 +33,10 @@ std::unique_ptr<AudioEncoder> AudioEncoderOpus::MakeAudioEncoder(
|
||||
const AudioEncoderOpusConfig& config,
|
||||
int payload_type,
|
||||
absl::optional<AudioCodecPairId> /*codec_pair_id*/) {
|
||||
if (!config.IsOk()) {
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return nullptr;
|
||||
}
|
||||
return AudioEncoderOpusImpl::MakeAudioEncoder(config, payload_type);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user