diff mbox

[FFmpeg-devel,6/7] avformat/wtvdec: Use AV_DICT_DONT_STRDUP_VAL to avoid av_strdup

Message ID 20191110040733.11755-5-andreas.rheinhardt@gmail.com
State New
Headers show

Commit Message

Andreas Rheinhardt Nov. 10, 2019, 4:07 a.m. UTC
This will likely also fix CID 1452571, a false positive resulting from
Coverity thinking that av_dict_set() automatically frees its key and
value parameters (even without the AV_DICT_DONT_STRDUP_* flags).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/wtvdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 706e8ca38d..3960e6ae2f 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -525,8 +525,7 @@  static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty
         return;
     }
 
-    av_dict_set(&s->metadata, key, buf, 0);
-    av_freep(&buf);
+    av_dict_set(&s->metadata, key, buf, AV_DICT_DONT_STRDUP_VAL);
 }
 
 /**