Avoid undefined behavior for removing elements that were not in the tree.

Originally committed as revision 15368 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer
2008-09-19 12:41:12 +00:00
parent 0354ddb71c
commit eed3607564
2 changed files with 7 additions and 6 deletions

View File

@@ -45,8 +45,7 @@ void *av_tree_find(const struct AVTreeNode *root, void *key, int (*cmp)(void *ke
/**
* Inserts or removes an element.
* If *next is NULL then the element supplied will be removed, if no such
* element exists behavior is undefined.
* If *next is NULL then the element supplied will be removed if it exists.
* If *next is not NULL then the element supplied will be inserted, unless
* it already exists in the tree.
* @param rootp A pointer to a pointer to the root node of the tree. Note that