aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-03-13 05:00:44 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-03-18 07:21:35 +0100
commitaf26a8ffbb8a553a890eefefd019cf2b1ccbdc84 (patch)
tree4e2c5ef972c9db58d8bf76d68ad5cb9a767dc270
parent590d169bdb48e0fc30975ef4a93c4617273314a5 (diff)
downloadffmpeg-af26a8ffbb8a553a890eefefd019cf2b1ccbdc84.tar.gz
avcodec/libmp3lame: Remove redundant av_packet_unref()
The AVPacket given to an encoder's encode callback is unreferenced generically on error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/libmp3lame.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 26e58baa3d..e119189f2a 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -280,17 +280,14 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
// Check if subtraction resulted in an overflow
if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) {
av_log(avctx, AV_LOG_ERROR, "discard padding overflow\n");
- av_packet_unref(avpkt);
return AVERROR(EINVAL);
}
if ((!s->delay_sent && avctx->initial_padding > 0) || discard_padding > 0) {
uint8_t* side_data = av_packet_new_side_data(avpkt,
AV_PKT_DATA_SKIP_SAMPLES,
10);
- if(!side_data) {
- av_packet_unref(avpkt);
+ if (!side_data)
return AVERROR(ENOMEM);
- }
if (!s->delay_sent) {
AV_WL32(side_data, avctx->initial_padding);
s->delay_sent = 1;