[FFmpeg-devel] mpegts memory leak
Måns Rullgård
mans
Wed Sep 29 21:48:27 CEST 2010
"Uve W. Rick" <Uve.Rick at uav.com> writes:
>> > + if (!ts->pkt->data) {
>> > + av_free(ts->pkt->data);
>> > + }
>>
>> This doesn't make sense, if ts->pkt->data is NULL there is no point
>> freeing it.
>
> If you look right below where the ts->pkt->data is set to NULL, you
> have the new_pes_packet this will set the ts->pkt->data. Then in
> the line right after the patch, you have another new_pes_packet. It
> is possible that both instances of new_pes_packet are called. In
> the current implementation, the ts->pkt->data is simply overwritten
> and the memory from the first call to new_pes_packet is lost.
How does calling free() on a null pointer help with any of this?
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list