diff mbox series

[FFmpeg-devel,2/6] avcodec/tiff: Avoid duplicating strings

Message ID AS8P250MB07443C42651DB49BC08708068F252@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 957053b52a2dae4e80df95ec70be1a8a7f2b2365
Headers show
Series [FFmpeg-devel,1/6] avcodec/tiff: Fix handling of av_strdup() failures | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt March 10, 2024, 2:15 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/tiff.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 4c7460cf41..afa1289e27 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -2028,7 +2028,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;