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.
This commit is contained in:
Josep Torra Valles 2008-02-12 18:29:29 +00:00 committed by Wim Taymans
parent 32c43f884e
commit fe7d133879
3 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2008-02-12 Wim Taymans <wim.taymans@collabora.co.uk>
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.
2008-02-12 Sebastian Dröge <slomo@circular-chaos.org>
* sys/dshowdecwrapper/gstdshowaudiodec.c:

2
common

@ -1 +1 @@
Subproject commit 05a617c9043ddb78f8578195b18c166d7e1d4c2e
Subproject commit 2a19465fdb43a75f4d32950fd2beb1beb950eec2

View file

@ -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;
}