diff mbox series

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

Message ID AS8P250MB074431FD61C253BE7ED6F9538FB89@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit f456c192d99019ff7f0587abb7a4802a1d7ba102
Headers show
Series [FFmpeg-devel,1/3] avfilter/vf_ssim360: Use correct type in sizeof | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt March 12, 2023, 9:53 p.m. UTC
Fixes Coverity issue #1518906.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/libx264.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Anton Khirnov March 14, 2023, 5:52 a.m. UTC | #1
Patches 3-6 LGTM
diff mbox series

Patch

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