Fix svace defect 28/53428/1 accepted/tizen/mobile/20151207.122741 accepted/tizen/tv/20151207.122757 accepted/tizen/wearable/20151207.122817 submit/tizen/20151207.011424
authorGilbok Lee <gilbok.lee@samsung.com>
Sun, 6 Dec 2015 23:14:08 +0000 (08:14 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Sun, 6 Dec 2015 23:14:08 +0000 (08:14 +0900)
Change-Id: I51e61d48839ae3a71774a90411c218544e6448a8
Signed-off-by: Gilbok Lee <gilbok.lee@samsung.com>
src/port_gst/mediademuxer_port_gst.c

index 8adc11f..1d4baf0 100755 (executable)
@@ -440,7 +440,6 @@ static int __gst_create_audio_only_pipeline(gpointer data,  GstCaps *caps)
                        gst_object_unref(queue_srcpad);
        }
 
-       g_free(type);
        /* calling "on_pad_added" function to set the caps */
        aud_srcpad = gst_element_get_static_pad(gst_handle->demux, "src");
        if (!aud_srcpad) {
@@ -474,6 +473,7 @@ static int __gst_create_audio_only_pipeline(gpointer data,  GstCaps *caps)
        }
        (head_track->num_audio_track)++;
        __gst_no_more_pad(gst_handle->demux, data);
+       g_free(type);
        MEDIADEMUXER_FLEAVE();
        return MD_ERROR_NONE;
 ERROR:
@@ -1210,11 +1210,16 @@ static int gst_demuxer_read_sample(MMHandleType pHandle,
                indx++;
        }
 
+       if (!atrack) {
+               MD_E("atrack is NULL\n");
+               goto ERROR;
+       }
+
        if (media_packet_create_alloc(atrack->format, NULL, NULL, &mediabuf)) {
-                       MD_E("media_packet_create_alloc failed\n");
-                       ret = MD_ERROR;
-                       goto ERROR;
-               }
+               MD_E("media_packet_create_alloc failed\n");
+               ret = MD_ERROR;
+               goto ERROR;
+       }
 
        if (indx != track_indx) {
                MD_E("Invalid track Index\n");