[FFmpeg-devel] [PATCH] tools/coverity: override av_dict_set

Timo Rothenpieler timo at rothenpieler.org
Sat Jul 11 21:20:42 EEST 2020


Coverity thinks av_dict_set frees the key and value parameter, because
it has the (rarely used) option to do so, and it's not smart enough to
figure out it depends on the flags parameter.
So lets provide a custom implementation that does not free them.
---
 tools/coverity.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/coverity.c b/tools/coverity.c
index 19a132a976..5e4eb19f39 100644
--- a/tools/coverity.c
+++ b/tools/coverity.c
@@ -77,3 +77,12 @@ void *av_free(void *ptr) {
     __coverity_mark_as_afm_freed__(ptr, "av_free");
 }
 
+int av_dict_set(void **pm, const char *key, const char *value, int flags) {
+    int has_memory;
+    if (has_memory) {
+        return 0;
+    } else {
+        return -1;
+    }
+}
+
-- 
2.25.1



More information about the ffmpeg-devel mailing list