summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2016-03-04 20:17:54 -0300
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-03-09 15:39:31 +0100
commit0a9161ac3a089146cefcfca416f4a889d39e9f4a (patch)
treeca726b5f565ee50ede9c8e37373ee5741b78edc7
parent2b47bf8c741e7cb0fd5a9705bdf826a1f87af72b (diff)
vaapidecoder_h265: plug leak of h265 parsing info
If something goes wrong while parsing, the info object is being leaked https://bugzilla.gnome.org/show_bug.cgi?id=763121
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_h265.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c
index cd6b66a3..3c5a9d91 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c
@@ -2828,7 +2828,7 @@ gst_vaapi_decoder_h265_parse (GstVaapiDecoder * base_decoder,
buf, 0, buf_size, &pi->nalu);
status = get_status (result);
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
- return status;
+ goto exit;
switch (pi->nalu.type) {
case GST_H265_NAL_VPS:
status = parse_vps (decoder, unit);
@@ -2866,7 +2866,7 @@ gst_vaapi_decoder_h265_parse (GstVaapiDecoder * base_decoder,
break;
}
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
- return status;
+ goto exit;
flags = 0;
if (at_au_end) {
flags |= GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END |
@@ -2941,6 +2941,10 @@ gst_vaapi_decoder_h265_parse (GstVaapiDecoder * base_decoder,
pi->flags = flags;
gst_vaapi_parser_info_h265_replace (&priv->prev_pi, pi);
return GST_VAAPI_DECODER_STATUS_SUCCESS;
+
+exit:
+ gst_vaapi_parser_info_h265_unref (pi);
+ return status;
}
static GstVaapiDecoderStatus