summaryrefslogtreecommitdiffstats
path: root/gst/h264parse
diff options
context:
space:
mode:
authorJosep Torra Valles <josep@fluendo.com>2008-02-12 18:29:29 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-02-12 18:29:29 +0000
commitfe7d13387940fa5fdead42a1f3e691c9e297c776 (patch)
tree4d6bb9895f0906289a24574d7effb91e4b0df482 /gst/h264parse
parent32c43f884e7e83e362d2b69b340ad9f4117a4f89 (diff)
downloadgst-plugins-bad-fe7d13387940fa5fdead42a1f3e691c9e297c776.tar.gz
gst-plugins-bad-fe7d13387940fa5fdead42a1f3e691c9e297c776.tar.bz2
gst-plugins-bad-fe7d13387940fa5fdead42a1f3e691c9e297c776.zip
gst/h264parse/gsth264parse.c: Fix potential buffer leak in reverse mode. Fixes #516061.
Original commit message from CVS: Patch by: Josep Torra Valles <josep@fluendo.com> * gst/h264parse/gsth264parse.c: (gst_h264_parse_chain_reverse): Fix potential buffer leak in reverse mode. Fixes #516061.
Diffstat (limited to 'gst/h264parse')
-rw-r--r--gst/h264parse/gsth264parse.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gst/h264parse/gsth264parse.c b/gst/h264parse/gsth264parse.c
index dee03969..12b2ba72 100644
--- a/gst/h264parse/gsth264parse.c
+++ b/gst/h264parse/gsth264parse.c
@@ -683,6 +683,7 @@ gst_h264_parse_chain_reverse (GstH264Parse * h264parse, gboolean discont,
GstBuffer * buffer)
{
GstFlowReturn res = GST_FLOW_OK;
+ GstBuffer *gbuf = NULL;
/* if we have a discont, move buffers to the decode list */
if (G_UNLIKELY (discont)) {
@@ -700,7 +701,6 @@ gst_h264_parse_chain_reverse (GstH264Parse * h264parse, gboolean discont,
h264parse->prev = NULL;
while (h264parse->gather) {
- GstBuffer *gbuf;
guint8 *data;
/* get new buffer and init the start code search to the end position */
@@ -761,6 +761,7 @@ gst_h264_parse_chain_reverse (GstH264Parse * h264parse, gboolean discont,
last);
prev = gst_buffer_create_sub (gbuf, 0, last);
gst_buffer_unref (gbuf);
+ gbuf = NULL;
break;
}
}
@@ -777,6 +778,12 @@ gst_h264_parse_chain_reverse (GstH264Parse * h264parse, gboolean discont,
GST_BUFFER_SIZE (buffer));
h264parse->gather = g_list_prepend (h264parse->gather, buffer);
}
+
+ if (gbuf) {
+ gst_buffer_unref (gbuf);
+ gbuf = NULL;
+ }
+
return res;
}