History

avformat/id3v2: Fix double-free on error

ff_id3v2_parse_priv_dict() uses av_dict_set() with the flags AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL. In this case both key and value are freed on error (and owned by the destination dictionary on success), so that freeing them again on error is a double-free and therefore forbidden. But it nevertheless happened. Fixes CID 1452489 and 1452421.

Andreas Rheinhardt committed 7 years ago

Commit 67d49401 parent e73688e1 file · +0 −2Browse files

Unified · Split

libavformat/id3v2.c+0−2
@@ -1264,8 +1264,6 @@ int ff_id3v2_parse_priv_dict(AVDictionary **metadata, ID3v2ExtraMeta **extra_met · 1263 unmodified lines
1264 }1264 }
1265 1265
1266 if ((ret = av_dict_set(metadata, key, escaped, dict_flags)) < 0) {1266 if ((ret = av_dict_set(metadata, key, escaped, dict_flags)) < 0) {
1267 av_free(key);
1268 av_free(escaped);
1269 return ret;1267 return ret;
1270 }1268 }
1271 }1269 }

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