diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-11-14 19:14:14 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-11-14 19:14:14 +0000 |
commit | edabf3592610323b7f2cf1bf7c6881ce3b4aebc5 (patch) | |
tree | 3d1c75195878480dec8ca1674f7102abbc3264da /libavutil/tree.c | |
parent | 25c4fddadc9df2d0101612febf648968a55b3175 (diff) | |
download | ffmpeg-edabf3592610323b7f2cf1bf7c6881ce3b4aebc5.tar.gz |
Fix crash with av_tree_enumerate(NULL).
Originally committed as revision 20537 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/tree.c')
-rw-r--r-- | libavutil/tree.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/tree.c b/libavutil/tree.c index 0781453685..85ef629b98 100644 --- a/libavutil/tree.c +++ b/libavutil/tree.c @@ -137,10 +137,12 @@ void av_tree_destroy(AVTreeNode *t){ #if 0 void av_tree_enumerate(AVTreeNode *t, void *opaque, int (*cmp)(void *opaque, void *elem), int (*enu)(void *opaque, void *elem)){ + if(t){ int v= cmp ? cmp(opaque, t->elem) : 0; if(v>=0) av_tree_enumerate(t->child[0], opaque, cmp, enu); if(v==0) enu(opaque, t->elem); if(v<=0) av_tree_enumerate(t->child[1], opaque, cmp, enu); + } } #endif |