GNOME Bugzilla – Bug 784735
gst-libav: Memory leak and possible crash in avio_alloc_context.
Last modified: 2017-07-25 08:50:15 UTC
Memory leak and possible crash in avio_alloc_context. gst-libav-1.12.1/ext/libav/gstavprotocol.c In function gst_ffmpegdata_open at line: 265 avio_alloc_context : There is no NULL check while deferring so I think if this function fails i.e return NULL then it should be possible crash and Memory leak of allocated buffer. Solution: NULL check should be applied before derefer and in case of failure buffer should be freed. As per API documentation :: Allocated AVIOContext or NULL on failure. This is for reference https://www.ffmpeg.org/doxygen/2.5/avio_8h.html#a853f5149136a27ffba3207d8520172a5 like above it should be also in function "gst_ffmpegdata_open" . Also there should be NULL check for handle h in "gst_ffmpegdata_close" and same also "gst_ffmpeg_pipe_close" Please consider it.
Can you provide a patch for this?
Yes.. I am preparing a patch for it..and soon I will upload it.
Created attachment 355396 [details] [review] Patch file is attached. Dear Slomo, Patch file is attached. With Regards Satya
Please review the attached patch and provide your feedback..
commit 98cf1a7e2d27d84041bd4d9a9252d55c1252d010 (HEAD -> master) Author: Satya Prakash Gupta <sp.gupta@samsung.com> Date: Tue Jul 11 11:34:03 2017 +0530 avdemux/mux: Memory leak and possible crash in avio_alloc_context https://bugzilla.gnome.org/show_bug.cgi?id=784735