[Ffmpeg-devel] Re: Memory leak in output_example ... ?

Mat heavensdoor78
Thu Sep 22 16:43:20 CEST 2005


Burkhard Plaum wrote:

>>==10241== 65552 bytes in 2 blocks are still reachable in loss record 2 of 2
>>==10241==    at 0x1B905141: memalign (vg_replace_malloc.c:216)
>>==10241==    by 0x80A8BAE: av_malloc (mem.c:62)
>>==10241==    by 0x80A6F56: av_mallocz (utils.c:63)
>>==10241==    by 0x80B498B: MPV_encode_defaults (mpegvideo.c:596)
>>==10241==    by 0x80AA939: MPV_encode_init (mpegvideo.c:893)
>>==10241==    by 0x81C485F: encode_init (mpeg12.c:224)
>>==10241==    by 0x80A7663: avcodec_open (utils.c:832)
>>==10241==    by 0x80546A0: open_video (output_example.c:262)
>>==10241==    by 0x8054EB1: main (output_example.c:465)
>>    
>>
>If the av_mallocz() in mpegvideo.c:596 is replaced by av_mallocz_static(),
>this leak should go away (it's one of those leaks, which are harmless for static
>linking but serious in shared libs). Not sure about the other one.
>  
>
Ahhh... now I see... same logic...
If I modify  mpeg12.c:800  ,  av_mallocz  in  av_mallocz_static  another 
memory leak is gone!
And finally if I modify  utils.c: 767  ,  av_malloc  in  
av_mallocz_static  all memory leaks is gone!
Great!
Thank you!

P.S.
av_malloc  vs  av_mallocz ... utils.c: 767 ...
is this good ?





More information about the ffmpeg-devel mailing list