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;