diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2008-02-12 10:57:27 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-02-12 10:57:27 +0000 |
commit | b5708310bbd53c8d1bcdd87b7d0e946a4cd78b01 (patch) | |
tree | a5305d5d53d0b4d4940b5688865869250a8a3d3a | |
parent | 571a20f2053c0276b1d95f0210a3e2ad00b0177f (diff) | |
download | gst-plugins-bad-b5708310bbd53c8d1bcdd87b7d0e946a4cd78b01.tar.gz gst-plugins-bad-b5708310bbd53c8d1bcdd87b7d0e946a4cd78b01.tar.bz2 gst-plugins-bad-b5708310bbd53c8d1bcdd87b7d0e946a4cd78b01.zip |
gst/mpegvideoparse/mpegvideoparse.c: Fix leaking caps.
Original commit message from CVS:
* gst/mpegvideoparse/mpegvideoparse.c:
(mpegvideoparse_handle_sequence), (mpegvideoparse_drain_avail),
(gst_mpegvideoparse_change_state):
Fix leaking caps.
Fix potential buffer leak in forward mode.
Cleanup queues when going to READY. Fixes #515815.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | gst/mpegvideoparse/mpegvideoparse.c | 11 |
2 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,12 @@ +2008-02-12 Wim Taymans <wim.taymans@collabora.co.uk> + + * gst/mpegvideoparse/mpegvideoparse.c: + (mpegvideoparse_handle_sequence), (mpegvideoparse_drain_avail), + (gst_mpegvideoparse_change_state): + Fix leaking caps. + Fix potential buffer leak in forward mode. + Cleanup queues when going to READY. Fixes #515815. + 2008-02-12 Sebastian Dröge <slomo@circular-chaos.org> * docs/plugins/gst-plugins-bad-plugins-docs.sgml: diff --git a/gst/mpegvideoparse/mpegvideoparse.c b/gst/mpegvideoparse/mpegvideoparse.c index 22859d90..97146faa 100644 --- a/gst/mpegvideoparse/mpegvideoparse.c +++ b/gst/mpegvideoparse/mpegvideoparse.c @@ -231,8 +231,11 @@ mpegvideoparse_handle_sequence (MpegVideoParse * mpegvideoparse, "codec_data", GST_TYPE_BUFFER, seq_buf, NULL); GST_DEBUG ("New mpegvideoparse caps: %" GST_PTR_FORMAT, caps); - if (!gst_pad_set_caps (mpegvideoparse->srcpad, caps)) + if (!gst_pad_set_caps (mpegvideoparse->srcpad, caps)) { + gst_caps_unref (caps); return FALSE; + } + gst_caps_unref (caps); /* And update the new_hdr into our stored version */ mpegvideoparse->seq_hdr = new_hdr; @@ -372,12 +375,15 @@ mpegvideoparse_drain_avail (MpegVideoParse * mpegvideoparse) mpegvideoparse->need_discont = FALSE; } res = gst_pad_push (mpegvideoparse->srcpad, buf); + buf = NULL; } /* Advance to the next data block */ mpeg_packetiser_next_block (&mpegvideoparse->packer); cur = mpeg_packetiser_get_block (&mpegvideoparse->packer, &buf); - }; + } + if (buf != NULL) + gst_buffer_unref (buf); return res; } @@ -824,6 +830,7 @@ gst_mpegvideoparse_change_state (GstElement * element, switch (transition) { case GST_STATE_CHANGE_PAUSED_TO_READY: mpv_parse_reset (mpegvideoparse); + gst_mpegvideoparse_flush (mpegvideoparse); break; default: break; |