[FFmpeg-cvslog] r18406 - in trunk/libavcodec: h264.c h264.h h264_parser.c

Reimar Döffinger Reimar.Doeffinger
Fri Apr 10 12:54:46 CEST 2009


On Fri, Apr 10, 2009 at 12:32:10PM +0200, Reimar D?ffinger wrote:
> On Fri, Apr 10, 2009 at 09:01:56AM +0200, reimar wrote:
> > Author: reimar
> > Date: Fri Apr 10 09:01:55 2009
> > New Revision: 18406
> > 
> > Log:
> > Add a ff_h264_free_context function and call it from the H.264 parser.
> > This ensures that the parser will no longer leak memory for all SPS/PPS it encounters.
> 
> Hmm.. there is a problem I missed...
> ff_h264_free_context calls free_tables - I think that would not be
> necessary to fix the memleak, but it does seem safer.
> The problem is though, that free_tables contains this:
> > for(i = 0; i < h->s.avctx->thread_count; i++) {
> and avctx is not set in the parser.
> Does adding a
> if (!h->s.avctx) return;
> before that seem a reasonable solution?

I was quite confused as to how I could miss this...
It seems neither FATE nor make test cover the H.264 parser, at
least not if it crashes upon closing, Mike could you consider maybe
adding one of the samples from issue 706 or 944 (with -an)? I guess the
full 6MB of those are probably a bit big...
I did confirm the leak to be gone with valgrind but in all the output
I probably missed the crash message (lesson learned: always test without
valgrind, too)...



More information about the ffmpeg-cvslog mailing list