[FFmpeg-devel] [PATCH 2/2] lavd/sdl: reset context variables after destroy

Lukasz M lukasz.m.luki at gmail.com
Fri Feb 7 17:04:37 CET 2014


On 7 February 2014 17:01, Nicolas George <george at nsup.org> wrote:

> Le nonidi 19 pluviôse, an CCXXII, Lukasz Marek a écrit :
> > SDL device reports double free or hangs when quiting.
> > Reseting variables solves the issue.
>
> I am a bit unsure about this: it actually fixes the actual double frees,
> but
> it still means someone is trying to free something they should not be
> freeing; the issue is only hidden, and other symptoms may be present.
>
> Did you investigate to find what part of the code does the second freeing?
>
> Not that I object to the patch: not leaving loaded pointers is usually good
> practice anyway. But maybe add a comment somewhere:
>
> /* XXX someone is trying to free this twice */
>

Yes, I investigated.
write_trailer is called for the first time in write_packet when quit flag
is set.
Second write_trailer comes from ffmpeg.c

I was thinking about removing that call from write_packet too, seems
redundant.


More information about the ffmpeg-devel mailing list