From 957053b52a2dae4e80df95ec70be1a8a7f2b2365 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sat, 9 Mar 2024 14:28:53 +0100 Subject: [PATCH] avcodec/tiff: Avoid duplicating strings Reviewed-by: Stefano Sabatini Signed-off-by: Andreas Rheinhardt --- 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;