]> git.sesse.net Git - ffmpeg/commitdiff
add a termination condition
authorAurelien Jacobs <aurel@gnuage.org>
Sun, 4 Jan 2009 17:48:19 +0000 (17:48 +0000)
committerAurelien Jacobs <aurel@gnuage.org>
Sun, 4 Jan 2009 17:48:19 +0000 (17:48 +0000)
Originally committed as revision 16422 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavutil/tree.c

index 64653aaccbc6d22cc8cc93e248bc918684d3f209..bf485ab3f76d9bd076606af842fd3e87f92d87a5 100644 (file)
@@ -128,9 +128,11 @@ void *av_tree_insert(AVTreeNode **tp, void *key, int (*cmp)(void *key, const voi
 }
 
 void av_tree_destroy(AVTreeNode *t){
+    if(t){
     av_tree_destroy(t->child[0]);
     av_tree_destroy(t->child[1]);
     av_free(t);
+    }
 }
 
 #if 0