From: SeokHoon Lee Date: Mon, 13 Feb 2017 06:02:56 +0000 (+0900) Subject: fix memoryleak and unerflow X-Git-Tag: accepted/tizen/common/20170214.173905^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4154b173ec1fd50d1c00c2628452f7be2f3ba076;p=platform%2Fupstream%2Fgst-plugins-tizen.git fix memoryleak and unerflow Signed-off-by: SeokHoon Lee Change-Id: Id3d760189f8bb32cf28f326eb07cd045016efcd0 --- diff --git a/wfdmanager/wfdbase/gstwfdsinkmessage.c b/wfdmanager/wfdbase/gstwfdsinkmessage.c index 550358f..83a3026 100644 --- a/wfdmanager/wfdbase/gstwfdsinkmessage.c +++ b/wfdmanager/wfdbase/gstwfdsinkmessage.c @@ -1398,12 +1398,14 @@ GstWFDResult gst_wfd_message_set_supported_video_format(GstWFDMessage *msg, GstW if (vCodec != GST_WFD_VIDEO_UNKNOWN) { msg->video_formats->list = g_new0(GstWFDVideoCodec, 1); + + temp >>= 1; while (temp) { nativeindex++; temp >>= 1; } - msg->video_formats->list->native = nativeindex - 1; + msg->video_formats->list->native = nativeindex; msg->video_formats->list->native <<= 3; if (vNative == GST_WFD_VIDEO_VESA_RESOLUTION) diff --git a/wfdtsdemux/wfdtsdemux.c b/wfdtsdemux/wfdtsdemux.c old mode 100755 new mode 100644 index f9a6a4b..50ff7d3 --- a/wfdtsdemux/wfdtsdemux.c +++ b/wfdtsdemux/wfdtsdemux.c @@ -1160,6 +1160,10 @@ create_pad_for_stream (WFDTSBase * base, WFDTSBaseStream * bstream, /* hack for itv hd (sid 10510, video pid 3401 */ if (program->program_number == 10510 && bstream->pid == 3401) { template = gst_static_pad_template_get (&video_template); + if (name) + g_free (name); + if (caps) + gst_caps_unref (caps); name = g_strdup_printf ("video_%04x", bstream->pid); caps = gst_caps_new_simple ("video/x-h264", "stream-format", G_TYPE_STRING, "byte-stream",