[FFmpeg-devel] Question: infinite loop in av_tree_destroy(..)

Michael Niedermayer michaelni
Sat Jan 3 23:04:15 CET 2009


On Sat, Jan 03, 2009 at 07:43:43PM +0100, Aurelien Jacobs wrote:
> Stefano Sabatini wrote:
> 
> > On date Saturday 2009-01-03 23:37:55 +0800, avcoder encoded:
> > > Dear:
> > > //@file:libavutil/tree.c
> > > void av_tree_destroy(AVTreeNode *t){
> > >     av_tree_destroy(t->child[0]);
> > >     av_tree_destroy(t->child[1]);
> > >     av_free(t);
> > > }
> > > 
> > > It seems that the codes is wrong!
> > 
> > Looks OK to me. Why do you think is wrong?
> 
> Because it lacks an ending condition...
> Something like this may be better:

looks ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090103/aafcf8a1/attachment.pgp>



More information about the ffmpeg-devel mailing list