Skip to content
Snippets Groups Projects
Commit b687f8e2 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

media: fix return value for mediaTypeToString

The function mediaTypeToString never checked for nullptr
return values, which could potentially lead to crashes.
This patch ensures it always returns a valid string for
all defined MediaType values.

Change-Id: I81ef8876e1f57265584fae02cdfaff2894ff9f8c
parent dc1c49b5
No related branches found
No related tags found
No related merge requests found
...@@ -136,7 +136,9 @@ MediaAttribute::mediaTypeToString(MediaType type) ...@@ -136,7 +136,9 @@ MediaAttribute::mediaTypeToString(MediaType type)
return libjami::Media::MediaAttributeValue::AUDIO; return libjami::Media::MediaAttributeValue::AUDIO;
if (type == MediaType::MEDIA_VIDEO) if (type == MediaType::MEDIA_VIDEO)
return libjami::Media::MediaAttributeValue::VIDEO; return libjami::Media::MediaAttributeValue::VIDEO;
return nullptr; if (type == MediaType::MEDIA_NONE)
return libjami::Media::MediaAttributeValue::SRC_TYPE_NONE;
return "UNKNOWN";
} }
bool bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment