summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorVineeth TM <vineeth.tm@samsung.com>2016-01-25 13:33:09 +0900
committerThiago Santos <thiagoss@osg.samsung.com>2016-01-25 10:07:55 -0300
commite389211aa54f2b1da9df9dbe80f8624ba5e045db (patch)
tree8cd384fdfd0900b5a5c59075aed55bc0a3d21e73 /gst
parent6a35a4018e4274ce1965054161e92291d19f6291 (diff)
downloadgstreamer-plugins-bad-e389211aa54f2b1da9df9dbe80f8624ba5e045db.tar.gz
h265parse: Fix buffer leak when sps is not present
When sps data is NULL, the buffer allocated and mapped is not being freed. In this scenario there is no need to allocate the buffer as we are supposed to return NULL. https://bugzilla.gnome.org/show_bug.cgi?id=761070
Diffstat (limited to 'gst')
-rw-r--r--gst/videoparsers/gsth265parse.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c
index 380102fe5..ea12c24c3 100644
--- a/gst/videoparsers/gsth265parse.c
+++ b/gst/videoparsers/gsth265parse.c
@@ -1073,6 +1073,10 @@ gst_h265_parse_make_codec_data (GstH265Parse * h265parse)
if (!found)
return NULL;
+ sps = h265parse->nalparser->last_sps;
+ if (!sps)
+ return NULL;
+
buf =
gst_buffer_new_allocate (NULL,
23 + num_arrays + (3 * num_arrays) + vps_size + sps_size + pps_size,
@@ -1082,9 +1086,6 @@ gst_h265_parse_make_codec_data (GstH265Parse * h265parse)
memset (data, 0, map.size);
nl = h265parse->nal_length_size;
- sps = h265parse->nalparser->last_sps;
- if (!sps)
- return NULL;
pft = &sps->profile_tier_level;
if (sps->vui_parameters_present_flag)
min_spatial_segmentation_idc = sps->vui_params.min_spatial_segmentation_idc;