GNOME Bugzilla – Bug 746887
mpeg2dec: fix a couple of leaks
Last modified: 2015-03-30 20:25:05 UTC
.
Created attachment 300447 [details] [review] mpeg2dec: fix config leak gst_buffer_pool_get_config() returns an owned GstStructure so there is no need to copy it when passing the reference to down_config.
Created attachment 300448 [details] [review] mpeg2dec: fix buffer leak in crop_buffer() gst_buffer_pool_acquire_buffer() gives us a new owned buffer while gst_buffer_replace() reffed it as well so we are one reference extra.
Review of attachment 300447 [details] [review]: Luis fixed that already. commit 31bf54a076d7ee2a938259b8c4e9358e024a12e6 Author: Luis de Bethencourt <luis.bg@samsung.com> Date: Tue Mar 24 12:50:43 2015 +0000 mpeg2dec: fix memory leak CID #1291630 diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c index 4a6a6e4..3ba2880 100644 --- a/ext/mpeg2dec/gstmpeg2dec.c +++ b/ext/mpeg2dec/gstmpeg2dec.c @@ -337,7 +337,7 @@ gst_mpeg2dec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query) if (!has_videometa) { dec->downstream_pool = pool; pool = NULL; - down_config = gst_structure_copy (config); + down_config = config; config = NULL; min = 2; max = 0;
Review of attachment 300448 [details] [review]: ::: ext/mpeg2dec/gstmpeg2dec.c @@ +512,2 @@ gst_buffer_replace (&in_frame->output_buffer, buffer); + gst_buffer_unref (buffer); That wasting a ref/unref. Just do the if (blabla) unref, blabla = buffer dance ?
Created attachment 300566 [details] [review] mpeg2dec: fix buffer leak in crop_buffer() gst_buffer_pool_acquire_buffer() gives us a new owned buffer while gst_buffer_replace() reffed it as well so we were one reference extra.
Merged removing the right end comment. Attachment 300566 [details] pushed as ca5fd56 - mpeg2dec: fix buffer leak in crop_buffer()