mirror of https://github.com/FFmpeg/FFmpeg.git
If a key already exists in an AVDictionary and the AV_DICT_APPEND flag is set, the old entry is at first discarded from the dictionary, but a pointer to the value is kept. Lateron enough memory to store the appended string is allocated; should this allocation fail, the old string is not freed and hence leaks. This commit changes this by moving creating the combined value to an earlier point in the function, which also ensures that the AVDictionary is unchanged in case of errors. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>pull/388/head
parent
f976ed7fcf
commit
c15dd31d2a
1 changed files with 12 additions and 16 deletions
Loading…
Reference in new issue