[0.6.37] fix svace issue 92/120492/2
authorEunhae Choi <eunhae1.choi@samsung.com>
Thu, 23 Mar 2017 06:10:43 +0000 (15:10 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Thu, 23 Mar 2017 06:11:13 +0000 (15:11 +0900)
review the svace comment at below commit.
https://review.tizen.org/gerrit/#/c/120293/

I added null check of _caps_to_string() return but the others are false alarm.

Change-Id: Ic15a49b7b377f60048fe1d22e9bc067f0efd5973

src/mm_player_priv.c

index 0e4e5b0..1f0559c 100644 (file)
@@ -2610,7 +2610,7 @@ __mmplayer_gst_decode_pad_added(GstElement *elem, GstPad *pad, gpointer data)
                        }
 
                        gchar *caps_str = gst_caps_to_string(caps);
-                       if (strstr(caps_str, "ST12") || strstr(caps_str, "SN12"))
+                       if (caps_str && (strstr(caps_str, "ST12") || strstr(caps_str, "SN12")))
                                player->set_mode.video_zc = TRUE;
 
                        MMPLAYER_FREEIF(caps_str);
@@ -3515,7 +3515,7 @@ __mmplayer_gst_decode_callback(GstElement *elem, GstPad *pad, gpointer data) //
                        goto ERROR;
                }
        } else if (strstr(name, "video")) {
-               if (strstr(caps_str, "ST12") || strstr(caps_str, "SN12"))
+               if (caps_str && (strstr(caps_str, "ST12") || strstr(caps_str, "SN12")))
                        player->set_mode.video_zc = TRUE;
 
                if (player->pipeline->videobin == NULL) {
@@ -10293,7 +10293,6 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
        GstElement* queue2 = NULL;
        GstPad* sinkpad = NULL;
        GstPad* qsrcpad = NULL;
-       gchar *caps_str = NULL;
        gint64 dur_bytes = 0L;
 
        guint max_buffer_size_bytes = 0;
@@ -10443,8 +10442,6 @@ __mmplayer_try_to_plug_decodebin(mm_player_t* player, GstPad *srcpad, const GstC
 
 ERROR:
 
-       MMPLAYER_FREEIF(caps_str);
-
        if (sinkpad)
                gst_object_unref(GST_OBJECT(sinkpad));