encoding-profile: Initialize variables to avoid build failures
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Fri, 23 Dec 2016 21:08:43 +0000 (18:08 -0300)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Fri, 23 Dec 2016 21:08:43 +0000 (18:08 -0300)
encoding-profile.c: In function ‘get_profile_format_from_possible_factory_name’:
encoding-profile.c:1532:6: error: ‘fact’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   if (fact)
      ^
encoding-profile.c: In function ‘profile_from_string’:
encoding-profile.c:1720:6: error: ‘res’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   if (profile)
      ^
cc1: all warnings being treated as errors

gst-libs/gst/pbutils/encoding-profile.c

index c40fe28..f9f4d3e 100644 (file)
@@ -1451,7 +1451,7 @@ gst_encoding_profile_find (const gchar * targetname, const gchar * profilename,
 static GstEncodingProfile *
 combo_search (const gchar * pname)
 {
-  GstEncodingProfile *res;
+  GstEncodingProfile *res = NULL;
   gchar **split;
   gint split_length;
 
@@ -1478,7 +1478,7 @@ get_profile_format_from_possible_factory_name (const gchar * factory_desc,
   GList *tmp;
   GstCaps *caps = NULL, *tmpcaps = gst_caps_from_string (factory_desc);
   GstStructure *tmpstruct;
-  GstElementFactory *fact;
+  GstElementFactory *fact = NULL;
 
   *new_factory_name = NULL;
   if (gst_caps_get_size (tmpcaps) != 1)