Commit f3dc83d2 authored by David Keijser's avatar David Keijser

Fix segfault when using invalid encoding profile

Trying to use gst_encoding_profile_get_file_extension on a
GstEncodingProfile with a cap containing a typo would result in strcmp
being called with NULL. Instead use g_strcmp0 that handles this case.

Part-of: <gstreamer/gst-plugins-base!929>
parent b3fe2d36
...@@ -1383,7 +1383,7 @@ gst_encoding_profile_get_file_extension (GstEncodingProfile * profile) ...@@ -1383,7 +1383,7 @@ gst_encoding_profile_get_file_extension (GstEncodingProfile * profile)
has_video = gst_encoding_container_profile_has_video (cprofile); has_video = gst_encoding_container_profile_has_video (cprofile);
/* Ogg */ /* Ogg */
if (strcmp (ext, "ogg") == 0) { if (g_strcmp0 (ext, "ogg") == 0) {
/* ogg with video => .ogv */ /* ogg with video => .ogv */
if (has_video) { if (has_video) {
ext = "ogv"; ext = "ogv";
...@@ -1404,7 +1404,7 @@ gst_encoding_profile_get_file_extension (GstEncodingProfile * profile) ...@@ -1404,7 +1404,7 @@ gst_encoding_profile_get_file_extension (GstEncodingProfile * profile)
} }
/* Matroska */ /* Matroska */
if (has_video && strcmp (ext, "mka") == 0) { if (has_video && g_strcmp0 (ext, "mka") == 0) {
ext = "mkv"; ext = "mkv";
goto done; goto done;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment