git.videolan.org
/
ffmpeg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Always set next correctly, even if a matching element is found (that is
[ffmpeg.git]
/
libavutil
/
tree.c
diff --git
a/libavutil/tree.c
b/libavutil/tree.c
index
c929e48
..
6126ffa
100644
(file)
--- a/
libavutil/tree.c
+++ b/
libavutil/tree.c
@@
-35,6
+35,10
@@
void *av_tree_find(const AVTreeNode *t, void *key, int (*cmp)(void *key, const v
if(next) next[(v>>31)^1]= t->elem;
return av_tree_find(t->child[v>>31], key, cmp, next);
}else{
if(next) next[(v>>31)^1]= t->elem;
return av_tree_find(t->child[v>>31], key, cmp, next);
}else{
+ if(next){
+ av_tree_find(t->child[0], key, cmp, next);
+ av_tree_find(t->child[1], key, cmp, next);
+ }
return t->elem;
}
}
return t->elem;
}
}
@@
-132,7
+136,7
@@
int cmp(const void *a, const void *b){
return a-b;
}
return a-b;
}
-int main(){
+int main(
void
){
int i,j,k;
AVTreeNode *root= NULL;
int i,j,k;
AVTreeNode *root= NULL;