diff mbox series

[FFmpeg-devel,2/3] libavcodec/libmp3lame: Don't free user-provided AVPacket

Message ID 20200523104413.10023-2-andreas.rheinhardt@gmail.com
State Accepted
Commit 7e6941e185649409f44fb5aa31207bd7b00d23cd
Headers show
Series [FFmpeg-devel,1/3] avcodec/libopusenc: Don't free user-provided AVPacket
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 23, 2020, 10:44 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/libmp3lame.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index ecdd2e334c..2beb28e569 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -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) {