History

avcodec/libmp3lame: Remove redundant av_packet_unref()

The AVPacket given to an encoder's encode callback is unreferenced generically on error.

Andreas Rheinhardt committed 3 years ago

Commit af26a8f1 parent 590d1691 file · +1 −4Browse files

Unified · Split

libavcodec/libmp3lame.c+1−4
@@ -280,17 +280,14 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 279 unmodified lines
280 // Check if subtraction resulted in an overflow280 // Check if subtraction resulted in an overflow
281 if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) {281 if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) {
282 av_log(avctx, AV_LOG_ERROR, "discard padding overflow\n");282 av_log(avctx, AV_LOG_ERROR, "discard padding overflow\n");
283 av_packet_unref(avpkt);
284 return AVERROR(EINVAL);283 return AVERROR(EINVAL);
285 }284 }
286 if ((!s->delay_sent && avctx->initial_padding > 0) || discard_padding > 0) {285 if ((!s->delay_sent && avctx->initial_padding > 0) || discard_padding > 0) {
287 uint8_t* side_data = av_packet_new_side_data(avpkt,286 uint8_t* side_data = av_packet_new_side_data(avpkt,
288 AV_PKT_DATA_SKIP_SAMPLES,287 AV_PKT_DATA_SKIP_SAMPLES,
289 10);288 10);
290 if(!side_data) {289 if (!side_data)
291 av_packet_unref(avpkt);
292 return AVERROR(ENOMEM);290 return AVERROR(ENOMEM);
293 }
294 if (!s->delay_sent) {291 if (!s->delay_sent) {
295 AV_WL32(side_data, avctx->initial_padding);292 AV_WL32(side_data, avctx->initial_padding);
296 s->delay_sent = 1;293 s->delay_sent = 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t