[FFmpeg-cvslog] avcodec/libx264: Fix leak in case of allocation failure

Andreas Rheinhardt git at videolan.org
Tue Mar 14 08:32:11 EET 2023


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Mar 12 22:51:06 2023 +0100| [f456c192d99019ff7f0587abb7a4802a1d7ba102] | committer: Andreas Rheinhardt

avcodec/libx264: Fix leak in case of allocation failure

Fixes Coverity issue #1518906.

Reviewed-by: Anton Khirnov <anton at khirnov.net>
Reviewed-by: Jan Ekström <jeebjp at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 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;
             }



More information about the ffmpeg-cvslog mailing list