X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavcodec%2Fwebp.c;h=81b2e9121127a786cc6c29440ee45450e12ed505;hb=83df0a84a99d8291e5e1c5f7e2289cbd89107881;hp=5c2961ff19f2b815be373845954a8800ba391379;hpb=74f5cb0189d61affc6550723c1f82d4ae76df1d5;p=ffmpeg diff --git a/libavcodec/webp.c b/libavcodec/webp.c index 5c2961ff19f..81b2e912112 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -196,7 +196,6 @@ typedef struct WebPContext { uint8_t *alpha_data; /* alpha chunk data */ int alpha_data_size; /* alpha chunk data size */ int has_exif; /* set after an EXIF chunk has been processed */ - AVDictionary *exif_metadata; /* EXIF chunk data */ int width; /* image width */ int height; /* image height */ int lossless; /* indicates lossless or lossy */ @@ -1386,7 +1385,6 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return AVERROR_INVALIDDATA; } - av_dict_free(&s->exif_metadata); while (bytestream2_get_bytes_left(&gb) > 8) { char chunk_str[5] = { 0 }; @@ -1463,6 +1461,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } case MKTAG('E', 'X', 'I', 'F'): { int le, ifd_offset, exif_offset = bytestream2_tell(&gb); + AVDictionary *exif_metadata = NULL; GetByteContext exif_gb; if (s->has_exif) { @@ -1484,15 +1483,15 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } bytestream2_seek(&exif_gb, ifd_offset, SEEK_SET); - if (avpriv_exif_decode_ifd(avctx, &exif_gb, le, 0, &s->exif_metadata) < 0) { + if (avpriv_exif_decode_ifd(avctx, &exif_gb, le, 0, &exif_metadata) < 0) { av_log(avctx, AV_LOG_ERROR, "error decoding Exif data\n"); goto exif_end; } - av_dict_copy(avpriv_frame_get_metadatap(data), s->exif_metadata, 0); + av_dict_copy(avpriv_frame_get_metadatap(data), exif_metadata, 0); exif_end: - av_dict_free(&s->exif_metadata); + av_dict_free(&exif_metadata); bytestream2_skip(&gb, chunk_size); break; }