[FFmpeg-devel] [PATCH] Fixed memory leak when using avformat_new_stream

Michael Niedermayer michaelni at gmx.at
Tue Jul 23 17:03:18 CEST 2013


On Tue, Jul 23, 2013 at 06:09:15PM +0530, Anshul wrote:
> On 06/27/2013 03:42 PM, Anshul wrote:
> >On 06/27/2013 03:24 PM, Paul B Mahol wrote:
> >>On 6/27/13, Anshul maheshwari <er.anshul.maheshwari at gmail.com> wrote:
> >>>vimrc setting were not good, again made patch
> >>You are top posting 2nd time, and patch should have space between "if"
> >>and "(" in "if(".
> >>
> >>>On Thu, Jun 27, 2013 at 3:06 PM, Paul B Mahol <onemda at gmail.com> wrote:
> >>>
> >>>>On 6/27/13, Anshul maheshwari <er.anshul.maheshwari at gmail.com> wrote:
> >>>>>---------- Forwarded message ----------
> >>>>>From: Anshul maheshwari <er.anshul.maheshwari at gmail.com>
> >>>>>Date: Thu, Jun 27, 2013 at 10:18 AM
> >>>>>Subject: [FFmpeg-devel] (no subject)
> >>>>>To: ffmpeg-devel at ffmpeg.org
> >>>>>
> >>>>>
> >>>>>i was trying to solve ticket
> >>>>>https://ffmpeg.org/trac/ffmpeg/ticket/2716
> >>>>,
> >>>>>i need to know  should i free those thngs in avformat_new_stream.
> >>>>>or we should call av_codec_open  and avcodec_close to do that
> >>>>>
> >>>>>
> >>>>>Anshul
> >>>>>_______________________________________________
> >>>>>ffmpeg-devel mailing list
> >>>>>ffmpeg-devel at ffmpeg.org
> >>>>>http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>>>>
> >>>>>
> >>>>>hi
> >>>>>
> >>>>>Mine previous patch was not made by git format-patch
> >>>>>so i made it again...
> >>>>Patch introduces different formatting.
> >>>>
> >>>>>thanks
> >>>>>anshul
> >>>>>
> >>>>_______________________________________________
> >>>>ffmpeg-devel mailing list
> >>>>ffmpeg-devel at ffmpeg.org
> >>>>http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>>>
> >>_______________________________________________
> >>ffmpeg-devel mailing list
> >>ffmpeg-devel at ffmpeg.org
> >>http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >i have tried again.
> >
> Hi Michael
> 
> I saw Your Post at https://ffmpeg.org/trac/ffmpeg/ticket/2716
> I was trying to install Vlc from source but it gave me error that
> configure: error: libavcodec versions 55 and later are not supported yet.
> 
> 
> Please help me with version or git of vlc , so that i can reproduce
> that crash.
> 

> I would like to know which are the part that has been called muti threaded,
> You were able to find race in vlc, please  name the thread and api that were
>  called simultaneously.

I didnt debug it fully so i dont know exactly what called what but
basically some avcodec_open() or close was called and before it
returned the newly added avcodec_close() was called
avcodec_open and close are only thread safe if a lock manager is set
which vlc does not set
I think vlc should be changed to use av_lockmgr_register() but even
then this patch isnt really safe as at least old vlc versions would
break and quite possibly other applications too.

Iam cc-ing jb as he might want to know about this though it can be
argued about if theres a bug currently or not. I am not aware of any
user vissible issue, only if this close call is added do problems
occur as more locking is than needed which would be automagically
be provided through a lock manager if one was set ...


> 
> Sorry to ask about git of vlc but vlc git is not working on my pc.
> 
> 
> Thanks
> Anshul
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130723/ef76cdd7/attachment.asc>


More information about the ffmpeg-devel mailing list