summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-10-02 18:58:39 -0300
committerJames Almer <jamrial@gmail.com>2017-10-02 18:58:53 -0300
commit712ee85816ef854761f30ea57ea628997bd62e60 (patch)
tree706e9dd46b113032f76c816547ab29ae1156f0fc
parentb591329c3afe445c45eaecadd5fe3b80a837ee2f (diff)
avcodec/encode: free non-referenced packets' side data in the old encode API functions
Fixes memleaks introduced by a22c6a4796ca1f2cbee6784262515da876fbec22.
-rw-r--r--libavcodec/encode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index dd50486bcf..c152228c92 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -227,6 +227,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
ret = av_packet_ref(&tmp, avpkt);
if (ret < 0)
return ret;
+ av_packet_unref(avpkt);
*avpkt = tmp;
}
}
@@ -325,6 +326,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
ret = av_packet_ref(&tmp, avpkt);
if (ret < 0)
return ret;
+ av_packet_unref(avpkt);
*avpkt = tmp;
}
}