You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
libavutil: fix memory leak of drmVersion
address sanitizer showed some leaks of drmVersion structs. `vaapi_device_create` did not call drmFreeVersion in all possible code paths.
This commit is contained in:
committed by
Marton Balint
parent
586898dc1f
commit
28461f2c43
@@ -1815,6 +1815,7 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
|
||||
"Failed to get DRM device info for device %d.\n", n);
|
||||
close(priv->drm_fd);
|
||||
priv->drm_fd = -1;
|
||||
drmFreeVersion(info);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1826,6 +1827,7 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
|
||||
drmFreeDevice(&device);
|
||||
close(priv->drm_fd);
|
||||
priv->drm_fd = -1;
|
||||
drmFreeVersion(info);
|
||||
continue;
|
||||
}
|
||||
av_log(ctx, AV_LOG_VERBOSE, "Trying to use "
|
||||
@@ -1833,6 +1835,7 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
|
||||
"with matching vendor id (%s).\n",
|
||||
n, vendor_id->value);
|
||||
drmFreeDevice(&device);
|
||||
drmFreeVersion(info);
|
||||
break;
|
||||
}
|
||||
drmFreeVersion(info);
|
||||
|
||||
Reference in New Issue
Block a user