ffmpeg | branch: master | Kacper Michajłow <kaspe...@gmail.com> | Sun Jan 26 20:40:27 2025 +0100| [4ba9ae7742a6f8a29d6486e25ff5709a075edb5b] | committer: Jan Ekström
avformat/vqf: fix memory leak in add_metadata() Signed-off-by: Kacper Michajłow <kaspe...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ba9ae7742a6f8a29d6486e25ff5709a075edb5b --- libavformat/vqf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/vqf.c b/libavformat/vqf.c index 58b1546f53..fbe54739cd 100644 --- a/libavformat/vqf.c +++ b/libavformat/vqf.c @@ -66,10 +66,10 @@ static int add_metadata(AVFormatContext *s, uint32_t tag, return AVERROR(ENOMEM); ret = avio_read(s->pb, buf, len); - if (ret < 0) - return ret; - if (len != ret) - return AVERROR_INVALIDDATA; + if (ret < 0 || ret != len) { + av_free(buf); + return ret < 0 ? ret : AVERROR_INVALIDDATA; + } buf[len] = 0; AV_WL32(key, tag); return av_dict_set(&s->metadata, key, buf, AV_DICT_DONT_STRDUP_VAL); _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".