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

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/libmp3lame.c+1−4
@@ -280,17 +280,14 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 279 unmodified lines
280280 // Check if subtraction resulted in an overflow
281281 if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) {
282282 av_log(avctx, AV_LOG_ERROR, "discard padding overflow\n");
283− av_packet_unref(avpkt);
284283 return AVERROR(EINVAL);
285284 }
286285 if ((!s->delay_sent && avctx->initial_padding > 0) || discard_padding > 0) {
287286 uint8_t* side_data = av_packet_new_side_data(avpkt,
288287 AV_PKT_DATA_SKIP_SAMPLES,
289288 10);
290− if(!side_data) {
291− av_packet_unref(avpkt);
289+ if (!side_data)
292290 return AVERROR(ENOMEM);
293− }
294291 if (!s->delay_sent) {
295292 AV_WL32(side_data, avctx->initial_padding);
296293 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