[FFmpeg-devel] mpegts memory leak

Uve W. Rick Uve.Rick
Wed Sep 29 15:55:00 CEST 2010



> -----Original Message-----
> From: ffmpeg-devel-bounces at mplayerhq.hu [mailto:ffmpeg-devel-
> bounces at mplayerhq.hu] On Behalf Of Carl Eugen Hoyos
> Sent: Tuesday, September 28, 2010 1:49 PM
> To: ffmpeg-devel at mplayerhq.hu
> Subject: Re: [FFmpeg-devel] mpegts memory leak
> 
> Uve W. Rick <Uve.Rick <at> uav.com> writes:
> 
> > The patch keeps the functionality the same as before, where the
> previous
> > packet is discarded.
> 
> Is this hunk related?
> 
> > +    ts->stop_parse = 1;
> >      pes->total_size = MAX_PES_PAYLOAD;
> >      pes->buffer = av_malloc(pes-
> >total_size+FF_INPUT_BUFFER_PADDING_SIZE);
> >      if (!pes->buffer)
> >          return AVERROR(ENOMEM);
> > -    ts->stop_parse = 1;
> 
> If not, please remove it.
> 

The line previous to what you have show is: 

new_pes_packet(pes, ts->pkt);

This creates a new packet. If you don't set the ts->stop_parse flag it is assumed no packet was create.  If you do execute the return you will have a memory leak.

> Carl Eugen
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list