Message ID | AS8P250MB074450A4F202F17747F6A0D48FB99@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM |
---|---|
State | Accepted |
Commit | e5abcf0d290df85b78b9f52d52e824a7f1123d11 |
Headers | show |
Series | [FFmpeg-devel,1/3] avcodec/libmp3lame: Remove redundant av_packet_unref() | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c index db5b0841e0..eb97e0fb41 100644 --- a/libavcodec/libfdk-aacenc.c +++ b/libavcodec/libfdk-aacenc.c @@ -475,16 +475,13 @@ static int aac_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;
The AVPacket given to an encoder's encode callback is unreferenced generically on error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/libfdk-aacenc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)