Browse code

add a termination condition

Originally committed as revision 16422 to svn://svn.ffmpeg.org/ffmpeg/trunk

Aurelien Jacobs authored on 2009/01/05 02:48:19
Showing 1 changed files
... ...
@@ -128,9 +128,11 @@ void *av_tree_insert(AVTreeNode **tp, void *key, int (*cmp)(void *key, const voi
128 128
 }
129 129
 
130 130
 void av_tree_destroy(AVTreeNode *t){
131
+    if(t){
131 132
     av_tree_destroy(t->child[0]);
132 133
     av_tree_destroy(t->child[1]);
133 134
     av_free(t);
135
+    }
134 136
 }
135 137
 
136 138
 #if 0