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 b803993b6d)
This commit is contained in:
Andreas Rheinhardt 2020-05-23 11:40:23 +02:00
parent 24b4c4c5ba
commit 526628058e
1 changed files with 0 additions and 2 deletions

View File

@ -362,7 +362,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) {
@ -371,7 +370,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);