Signed-off-by: Kacper Michajłow <[email protected]>
---
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);
--
2.45.1
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".