aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-23 11:40:23 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-23 20:47:33 +0200
commit174ce949d707476e9f7e4a215b69e2c3a42569f4 (patch)
treed5f5295a3afd939a66c5911c6a6f0467385436fb
parentc13febd84353417f83c5f3ec4855e847af048733 (diff)
downloadffmpeg-174ce949d707476e9f7e4a215b69e2c3a42569f4.tar.gz
avcodec/libopusenc: Don't free user-provided AVPacket
Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit b803993b6d99423c8c1e01e7e206e3916a98d5d5)
-rw-r--r--libavcodec/libopusenc.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c
index c40fcde7ba..ee91cd9653 100644
--- a/libavcodec/libopusenc.c
+++ b/libavcodec/libopusenc.c
@@ -482,7 +482,6 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
// Check if subtraction resulted in an overflow
if ((discard_padding < opus->opts.packet_size) != (avpkt->duration > 0)) {
av_packet_unref(avpkt);
- av_free(avpkt);
return AVERROR(EINVAL);
}
if (discard_padding > 0) {
@@ -491,7 +490,6 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
10);
if(!side_data) {
av_packet_unref(avpkt);
- av_free(avpkt);
return AVERROR(ENOMEM);
}
AV_WL32(side_data + 4, discard_padding);