History

avformat/vqf: fix memory leak in add_metadata()

Kacper Michajłow committed 1 year ago

Commit 4ba9ae71 parent ca355091 file · +4 −4Browse files

Unified · Split

libavformat/vqf.c+4−4
@@ -66,10 +66,10 @@ static int add_metadata(AVFormatContext *s, uint32_t tag, · 65 unmodified lines
66 return AVERROR(ENOMEM);66 return AVERROR(ENOMEM);
67 67
68 ret = avio_read(s->pb, buf, len);68 ret = avio_read(s->pb, buf, len);
69 if (ret < 0)69 if (ret < 0 || ret != len) {
70 return ret;70 av_free(buf);
71 if (len != ret)71 return ret < 0 ? ret : AVERROR_INVALIDDATA;
72 return AVERROR_INVALIDDATA;72 }
73 buf[len] = 0;73 buf[len] = 0;
74 AV_WL32(key, tag);74 AV_WL32(key, tag);
75 return av_dict_set(&s->metadata, key, buf, AV_DICT_DONT_STRDUP_VAL);75 return av_dict_set(&s->metadata, key, buf, AV_DICT_DONT_STRDUP_VAL);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t