[FFmpeg-devel] [PATCH 3/3] avcodec/libx264: Fix leak in case of allocation failure

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Mar 12 23:53:45 EET 2023


Fixes Coverity issue #1518906.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 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;
             }
-- 
2.34.1



More information about the ffmpeg-devel mailing list