[Theora-dev] Re: Small memory leak...

Mat heavensdoor78 at gmail.com
Fri Oct 28 01:14:27 PDT 2005


Ralph Giles wrote:

>On Thu, Oct 27, 2005 at 12:38:20PM +0200, Mat wrote:
>
>>f I put  _ogg_free(op.packet)  before  theora_clear( &td )  I get 
>>segfault  in  theora_clear(), if I put it  after I get segfault in 
>>_ogg_free(op.packet) ...
>>Argh... I can't get the point :(
>>    
>>
>You want to call _ogg_free(op.packet) on line 196, after you call
>ogg_stream_packetin() which copies the comment packet data into
>the ogg stream state, but before you call theora_encode_tables(),
>which overwrites op.packet with a new buffer, causing the leak.
>  
>
Great ! It works ! :)
Thank you very much Ralph.

If I can suggest 2 small advices...
- Include the  _ogg_free  line  in  encoder_example.c ...
- I think it should useful to include in the theora source a small 
example like the one I proposed.
Smaller than  encoder_example.c  ...  perhaps  encoder_example2.c  which 
simply encode some programmatically generated images...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/theora-dev/attachments/20051028/f16fa499/attachment.html


More information about the Theora-dev mailing list