mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
libs: video: Add protection against null strings
Check and assert if input for gst_video_format_from_string is null. Return GST_VIDEO_FORMAT_UNKNOWN as a fallback
This commit is contained in:
parent
d15756105a
commit
123671bc05
1 changed files with 2 additions and 0 deletions
|
@ -535,6 +535,8 @@ gst_video_format_from_string (const gchar * format)
|
|||
{
|
||||
guint i;
|
||||
|
||||
g_return_val_if_fail (format != NULL, GST_VIDEO_FORMAT_UNKNOWN);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (formats); i++) {
|
||||
if (strcmp (GST_VIDEO_FORMAT_INFO_NAME (&formats[i].info), format) == 0)
|
||||
return GST_VIDEO_FORMAT_INFO_FORMAT (&formats[i].info);
|
||||
|
|
Loading…
Reference in a new issue