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.
Unified · Split
| @@ -1264,8 +1264,6 @@ int ff_id3v2_parse_priv_dict(AVDictionary **metadata, ID3v2ExtraMeta **extra_met · 1263 unmodified lines | ||
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | 1266 | if ((ret = av_dict_set(metadata, key, escaped, dict_flags)) < 0) { |
| 1267 | − av_free(key); | |
| 1268 | − av_free(escaped); | |
| 1269 | 1267 | return ret; |
| 1270 | 1268 | } |
| 1271 | 1269 | } |