[FFmpeg-cvslog] avcodec/tiff: Avoid duplicating strings

Andreas Rheinhardt git at videolan.org
Tue Mar 12 15:52:03 EET 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Mar  9 14:28:53 2024 +0100| [957053b52a2dae4e80df95ec70be1a8a7f2b2365] | committer: Andreas Rheinhardt

avcodec/tiff: Avoid duplicating strings

Reviewed-by: Stefano Sabatini <stefasab at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=957053b52a2dae4e80df95ec70be1a8a7f2b2365
---

 libavcodec/tiff.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index ffd0806bd1..c45fd34dbc 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -2029,7 +2029,8 @@ again:
             av_log(avctx, AV_LOG_WARNING, "Type of GeoTIFF key %d is wrong\n", s->geotags[i].key);
             continue;
         }
-        ret = av_dict_set(&p->metadata, keyname, s->geotags[i].val, 0);
+        ret = av_dict_set(&p->metadata, keyname, s->geotags[i].val, AV_DICT_DONT_STRDUP_VAL);
+        s->geotags[i].val = NULL;
         if (ret<0) {
             av_log(avctx, AV_LOG_ERROR, "Writing metadata with key '%s' failed\n", keyname);
             return ret;



More information about the ffmpeg-cvslog mailing list