[SDL] Leaks in FFPLAY

Lilith Calbridge lilith at dcccd.edu
Fri May 11 06:49:23 PDT 2007



>>> On 5/10/2007 at 7:54 PM, Pankaj <panky_13210 at yahoo.com> wrote:
> Hi,
>  I came across this piece of code
> 
> *pkt = pkt1->pkt;
> av_free(pkt1);
> 
> Pkt1 is a struct  defined as 
> 
> typedef struct AVPacketList {
> AVPacket pkt;
> struct AVPacketList *next;
> } AVPacketList;
> 
> I do not understand if we are freeing something then how can use it
again. ? 

I haven't looked at the existing code but you can always reassign the
pointer with a "new" statement.  It wouldn't have any of the previous
data in it but it would still be usable.

-- 
Lilith


More information about the SDL mailing list