srt: Avoid crash on unknown option
authorOlivier CrĂȘte <olivier.crete@collabora.com>
Tue, 3 Jan 2023 20:01:37 +0000 (15:01 -0500)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 4 Jan 2023 02:45:51 +0000 (02:45 +0000)
Use the correct field that is null instead of the struct value which
never is.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3672>

subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c

index e49e655..d16e2b9 100644 (file)
@@ -795,7 +795,7 @@ gst_srt_object_set_socket_option (GstStructure * s, const gchar * key,
 {
   SrtOption *option = srt_options;
 
-  for (; option; ++option) {
+  for (; option->name; ++option) {
     if (g_str_equal (key, option->name)) {
       switch (option->gtype) {
         case G_TYPE_INT: