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

Submitted by Andreas Rheinhardt on Nov. 10, 2019, 4:07 a.m.

Details

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

Commit Message

Andreas Rheinhardt Nov. 10, 2019, 4:07 a.m.
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(-)

Patch hide | download patch | download mbox

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);
 }
 
 /**