]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mlpenc: free filter state buffers on allocation failure
authorJames Almer <jamrial@gmail.com>
Wed, 24 Jun 2020 13:25:39 +0000 (10:25 -0300)
committerJames Almer <jamrial@gmail.com>
Wed, 1 Jul 2020 03:24:25 +0000 (00:24 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/mlpenc.c

index 4d50f0ea33b549b4ae82bc6febd48289c915ebe7..52ea06ed91f7a6fceb7953f39e56c4391413ae18 100644 (file)
@@ -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;
         }
     }