]> git.sesse.net Git - ffmpeg/commitdiff
libavcodec/libmp3lame: Don't free user-provided AVPacket
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 23 May 2020 10:11:30 +0000 (12:11 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 23 May 2020 18:25:08 +0000 (20:25 +0200)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/libmp3lame.c

index ecdd2e334c6d4edd93ea4fae3d7a043b5fa1b581..2beb28e569ee19658247ce86f87c0c4a035c2ddf 100644 (file)
@@ -279,7 +279,6 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) {
             av_log(avctx, AV_LOG_ERROR, "discard padding overflow\n");
             av_packet_unref(avpkt);
-            av_free(avpkt);
             return AVERROR(EINVAL);
         }
         if ((!s->delay_sent && avctx->initial_padding > 0) || discard_padding > 0) {
@@ -288,7 +287,6 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
                                                          10);
             if(!side_data) {
                 av_packet_unref(avpkt);
-                av_free(avpkt);
                 return AVERROR(ENOMEM);
             }
             if (!s->delay_sent) {