diff options
Diffstat (limited to 'pica-client/audiovideocallcontroller.cpp')
| -rw-r--r-- | pica-client/audiovideocallcontroller.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pica-client/audiovideocallcontroller.cpp b/pica-client/audiovideocallcontroller.cpp index 5b3c05c..8f7c8df 100644 --- a/pica-client/audiovideocallcontroller.cpp +++ b/pica-client/audiovideocallcontroller.cpp @@ -483,6 +483,14 @@ void AudioVideoCallController::incoming_audio_params(QByteArray peer_id, QString if (!is_active || peer_id != m_peer_id) return; + // The codec name is peer-supplied and would otherwise be handed straight + // to the FFmpeg decoder - accept only the ones the client itself sends. + if (!callAudioCodecAccepted(codec)) + { + qWarning() << "rejecting unsupported call audio codec from peer:" << codec; + return; + } + Settings st(config_dbname); QString playDev = st.loadValue("audio.playback_device", "default").toString(); @@ -578,6 +586,14 @@ void AudioVideoCallController::incoming_video_params(QByteArray peer_id, QString if (!is_active || peer_id != m_peer_id) return; + // As in incoming_audio_params(): the peer-supplied codec name must be one + // we actually send before it reaches avcodec_find_decoder_by_name(). + if (!callVideoCodecAccepted(codec)) + { + qWarning() << "rejecting unsupported call video codec from peer:" << codec; + return; + } + Settings st(config_dbname); const CallSettings cs = CallSettings::load(); bool vaapiRendering = st.loadValue("video.vaapi_rendering", 0).toBool(); |
