[libav-bugs] [Bug 273] New: av_close_input_file memory leak with custom IO

bugzilla-daemon at aruru.libav.org bugzilla-daemon at aruru.libav.org
Wed Apr 18 18:45:02 CEST 2012


           Summary: av_close_input_file memory leak with custom IO
           Product: Libav
           Version: git HEAD
          Platform: X86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: libavformat
        AssignedTo: bugzilla at libav.org
        ReportedBy: solal.jacob at arxsys.fr

I use custom IO (avio_alloc_context, avformat_open_input) and when closing with
av_close_input_file  the AVIOContext->buffer and AVIOContext must be freed but
it's not the case causing a memory leak. 

In av_close_input_file we can read : 

AVIOContext *pb = (s->iformat->flags & AVFMT_NOFILE) || (s->flags &
                       NULL : s->pb;
    if (pb)

As we can read if AVFMT_FLAG_CUSTOM_IO is set avio_close is not called, and if
I'm not wrong it must be called in order to free AVIOContext->buffer and

(I fix that in my code doing av_free(pb->buffer), av_free(pb), before calling

Configure bugmail: https://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the libav-bugs mailing list