[FFmpeg-cvslog] avcodec/mlpenc: free filter state buffers on allocation failure

James Almer git at videolan.org
Wed Jul 1 06:26:51 EEST 2020


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Jun 24 10:25:39 2020 -0300| [52b9bd2c95aec2c6e4a35923d2fc920c5f00033c] | committer: James Almer

avcodec/mlpenc: free filter state buffers on allocation failure

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=52b9bd2c95aec2c6e4a35923d2fc920c5f00033c
---

 libavcodec/mlpenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
index 4d50f0ea33..52ea06ed91 100644
--- a/libavcodec/mlpenc.c
+++ b/libavcodec/mlpenc.c
@@ -1820,7 +1820,8 @@ static int apply_filter(MLPEncodeContext *ctx, unsigned int channel)
         if (!filter_state_buffer[i]) {
             av_log(ctx->avctx, AV_LOG_ERROR,
                    "Not enough memory for applying filters.\n");
-            return AVERROR(ENOMEM);
+            ret = AVERROR(ENOMEM);
+            goto free_and_return;
         }
     }
 



More information about the ffmpeg-cvslog mailing list