summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-06-24 10:25:39 -0300
committerJames Almer <jamrial@gmail.com>2020-07-01 00:24:25 -0300
commit52b9bd2c95aec2c6e4a35923d2fc920c5f00033c (patch)
treef0787308fe55b1a3ff42cea70b45f67281eb8723
parent4cdd2d6d4cd1ddc113d1f528e0877b6b98ad6b13 (diff)
avcodec/mlpenc: free filter state buffers on allocation failure
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/mlpenc.c3
1 files changed, 2 insertions, 1 deletions
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;
}
}