[FFmpeg-cvslog] avcodec/vulkan_encode_hevc: Fix memleak on error

Andreas Rheinhardt git at videolan.org
Thu May 15 03:03:05 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon May  5 22:16:13 2025 +0200| [d794ecd9d2d2bd3ebcdeb4c033fd5d9ae85cdfc4] | committer: Andreas Rheinhardt

avcodec/vulkan_encode_hevc: Fix memleak on error

Reviewed-by: Lynne <dev at lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/vulkan_encode_h265.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vulkan_encode_h265.c b/libavcodec/vulkan_encode_h265.c
index a1f9528ac3..d81d2de95a 100644
--- a/libavcodec/vulkan_encode_h265.c
+++ b/libavcodec/vulkan_encode_h265.c
@@ -1218,7 +1218,7 @@ static int parse_feedback_units(AVCodecContext *avctx,
     if (err < 0) {
         av_log(avctx, AV_LOG_ERROR, "Unable to parse feedback units, bad drivers: %s\n",
                av_err2str(err));
-        return err;
+        goto fail;
     }
 
     if (sps_override) {
@@ -1246,10 +1246,12 @@ static int parse_feedback_units(AVCodecContext *avctx,
         }
     }
 
+    err = 0;
+fail:
     ff_cbs_fragment_free(&au);
     ff_cbs_close(&cbs);
 
-    return 0;
+    return err;
 }
 
 static int init_base_units(AVCodecContext *avctx)



More information about the ffmpeg-cvslog mailing list