From a09196f5739247b99ab1f84c1b04f9a6ea81b1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joni=20R=C3=A4s=C3=A4nen?= Date: Mon, 29 Jul 2024 15:35:13 +0300 Subject: [PATCH] common: Avoid crash if zrtp has not finished --- src/media_stream.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/media_stream.cc b/src/media_stream.cc index c7750ea7..70c56989 100644 --- a/src/media_stream.cc +++ b/src/media_stream.cc @@ -754,6 +754,12 @@ rtp_error_t uvgrtp::media_stream::check_push_preconditions(int rtp_flags, bool s return RTP_GENERIC_ERROR; } + if (media_ == nullptr) + { + UVG_LOG_ERROR("Media not intialized"); + return RTP_GENERIC_ERROR; + } + if (smart_pointer && (rtp_flags & RTP_COPY)) { UVG_LOG_ERROR("Copying a smart pointer does not make sense since the original would be lost");