[FFmpeg-devel] [PATCH 18/18] avformat/amvenc: Remove unnecessary av_packet_free()

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Fri Mar 19 07:59:04 EET 2021


The muxer's deinit function takes care of cleaning up when init fails.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavformat/amvenc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavformat/amvenc.c b/libavformat/amvenc.c
index 5d13b618f4..362b474fa6 100644
--- a/libavformat/amvenc.c
+++ b/libavformat/amvenc.c
@@ -187,7 +187,6 @@ static av_cold int amv_init(AVFormatContext *s)
     if (!amv->apad)
         return AVERROR(ENOMEM);
     if ((ret = av_new_packet(amv->apad, amv->ablock_align)) < 0) {
-        av_packet_free(&amv->apad);
         return ret;
     }
 
@@ -197,7 +196,6 @@ static av_cold int amv_init(AVFormatContext *s)
 
     amv->vpad = av_packet_alloc();
     if (!amv->vpad) {
-        av_packet_free(&amv->apad);
         return AVERROR(ENOMEM);
     }
     amv->vpad->stream_index = AMV_STREAM_VIDEO;
-- 
2.27.0



More information about the ffmpeg-devel mailing list