[FFmpeg-devel] [PATCH] fix memleak in packet corrupt dropping code

Chris Kennedy bitbytebit at gmail.com
Tue Oct 18 07:13:04 CEST 2011


I thought it was, but now can see it's not.  Had thought it might somehow
include some setup that needed to be done first.

Thanks,
Chris

On Mon, Oct 17, 2011 at 5:10 PM, Michael Niedermayer <michaelni at gmx.at>wrote:

> On Mon, Oct 17, 2011 at 10:33:13AM -0500, Chris Kennedy wrote:
> >
> > There is a memleak in the packet dropping method used when
> > packets are corrupt, this patch fixes it.  Valgrind shows
> > it nice after this change, otherwise it leaks...
> [...]
> >  utils.c |    3 +++
> >  1 file changed, 3 insertions(+)
> > 51242e3cbef916224f68d1ce908a14a65d834d89  corrupt_packet_memleak.diff
> > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > index c7eb93f..849dbce 100644
> > --- a/libavformat/utils.c
> > +++ b/libavformat/utils.c
> > @@ -756,6 +756,9 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt)
> >              av_log(s, AV_LOG_WARNING,
> >                     "Dropped corrupted packet (stream = %d)\n",
> >                     pkt->stream_index);
> > +            if(!(s->flags & AVFMT_FLAG_KEEP_SIDE_DATA))
> > +                av_packet_merge_side_data(pkt);
> > +           av_free_packet(pkt);
> >              continue;
>
> why do you call  av_packet_merge_side_data() before ?
> that should not be needed
>
> [...]
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker.
> User
> questions about the command line tools should be sent to the ffmpeg-user
> ML.
> And questions about how to use libav* should be sent to the libav-user ML.
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>


-- 
---
Chris Kennedy


More information about the ffmpeg-devel mailing list