GNOME Bugzilla – Bug 703980
sink: fix memory leak on unchecked uploader ptr
Last modified: 2013-08-26 11:06:27 UTC
Created attachment 248905 [details] [review] 0001-vaapisink-fix-memory-leak-on-unchecked-uploader-ptr Use gst_vaapisink_ensure_uploader instead of unsafe call on gst_vaapi_uploader_new
Review of attachment 248905 [details] [review]: The patch looks good, but the real question would be why are we calling _start() twice without a _stop() in between? Adding this patch right now would hide the real issue. Please try to investigate more this one: why is the patch needed?
Hi, this patch was fixed on 0.4-branch, I'm not sure master branch have the same issue. the reason is step 1. gst_vaapisink_get_caps was called first, which called gst_vaapisink_ensure_uploader to new a uploader. step 2. After step 1, gst_vaapisink_start was called, it doesn't check *sink->uploader* pointer but directly new a uploader and caused the memory leak.
(In reply to comment #2) > this patch was fixed on 0.4-branch, I'm not sure master branch have the same > issue. > the reason is > step 1. gst_vaapisink_get_caps was called first, which called > gst_vaapisink_ensure_uploader to new a uploader. > step 2. After step 1, gst_vaapisink_start was called, it doesn't check > *sink->uploader* pointer but directly new a uploader and caused the memory > leak. Thanks, that's clearer.
Fixed in git master branch. Thanks.
commit e5a50af2ae9c8d82c749854460f87f18e3a64640 Author: Wind Yuan <feng.yuan@intel.com> Date: Tue May 14 15:19:04 2013 +0800 vaapisink: fix memory leak of GstVaapiUploader instance. Make sure gst_vaapisink_ensure_uploader() checks for the existence of a former GstVaapiUploader instance prior to forcibly creating a new one. https://bugzilla.gnome.org/show_bug.cgi?id=703980