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

Stefano Sabatini stefasab at gmail.com
Sun Mar 10 17:34:14 EET 2024


On date Sunday 2024-03-10 15:15:00 +0100, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>  libavcodec/tiff.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 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;

Should be OK, thanks.


More information about the ffmpeg-devel mailing list