From f456c192d99019ff7f0587abb7a4802a1d7ba102 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sun, 12 Mar 2023 22:51:06 +0100 Subject: [PATCH] avcodec/libx264: Fix leak in case of allocation failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes Coverity issue #1518906. Reviewed-by: Anton Khirnov Reviewed-by: Jan Ekström Signed-off-by: Andreas Rheinhardt --- libavcodec/libx264.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index f65ac5dacc..e59939a8a7 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -503,6 +503,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (sei_data) { pic->extra_sei.payloads = av_mallocz(sizeof(pic->extra_sei.payloads[0])); if (pic->extra_sei.payloads == NULL) { + av_free(sei_data); ret = AVERROR(ENOMEM); goto fail; }