Explorar o código

avformat/matroskaenc: fix leak on error

Signed-off-by: James Almer <jamrial@gmail.com>
Tristan Matthews %!s(int64=6) %!d(string=hai) anos
pai
achega
1ec777dcdd
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      libavformat/matroskaenc.c

+ 3 - 1
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) {