summaryrefslogtreecommitdiffstats
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorTristan Matthews <tmatth@videolan.org>2019-04-04 12:56:26 -0400
committerJames Almer <jamrial@gmail.com>2019-04-09 10:49:05 -0300
commit1ec777dcdd03b43d3d694c3b4532dccea0b419f0 (patch)
tree682c98ea834547e4a2b7fe04b15374ea198ceeae /libavformat/matroskaenc.c
parentd6a8392224c0ee4cc00f9cf800910cf9120e0b88 (diff)
downloadffmpeg-streaming-1ec777dcdd03b43d3d694c3b4532dccea0b419f0.zip
ffmpeg-streaming-1ec777dcdd03b43d3d694c3b4532dccea0b419f0.tar.gz
avformat/matroskaenc: fix leak on error
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 06f3aeb..1c98c0d 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -694,8 +694,10 @@ static int put_flac_codecpriv(AVFormatContext *s,
av_dict_set(&dict, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", buf, 0);
len = ff_vorbiscomment_length(dict, vendor, NULL, 0);
- if (len >= ((1<<24) - 4))
+ if (len >= ((1<<24) - 4)) {
+ av_dict_free(&dict);
return AVERROR(EINVAL);
+ }
data = av_malloc(len + 4);
if (!data) {
OpenPOWER on IntegriCloud