[FFmpeg-devel] [PATCH] lavu/hwcontext_vaapi: Fix drmVersionPtr leak

Vicki Pfau vi at endrift.com
Thu Jun 5 13:52:04 EEST 2025


A new branch was added to this loop in dbd74ba3c8f2a11f6ce6c177acfd3bbf1c0ba763
that would either continue or break, but neglected to free the pointer obtained
during the loop that had been freed in all previous paths.

Signed-off-by: Vicki Pfau <vi at endrift.com>
---
 libavutil/hwcontext_vaapi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 95aa38d9d2..04f3ca4344 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -1808,6 +1808,7 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
                 } else if (vendor_id) {
                     drmDevicePtr device;
                     char drm_vendor[8];
+                    drmFreeVersion(info);
                     if (drmGetDevice(priv->drm_fd, &device)) {
                         av_log(ctx, AV_LOG_VERBOSE,
                                "Failed to get DRM device info for device %d.\n", n);
-- 
2.49.0



More information about the ffmpeg-devel mailing list