You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avdevice/decklink: fix leak when listing devices and there is no memory
Fixes Coverity CID 1419523. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
@@ -322,21 +322,14 @@ int ff_decklink_list_devices(AVFormatContext *avctx,
|
|||||||
ret = AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
|
||||||
new_device->device_name = av_strdup(displayName);
|
new_device->device_name = av_strdup(displayName);
|
||||||
if (!new_device->device_name) {
|
|
||||||
ret = AVERROR(ENOMEM);
|
|
||||||
goto next;
|
|
||||||
}
|
|
||||||
|
|
||||||
new_device->device_description = av_strdup(displayName);
|
new_device->device_description = av_strdup(displayName);
|
||||||
if (!new_device->device_description) {
|
|
||||||
av_freep(&new_device->device_name);
|
|
||||||
ret = AVERROR(ENOMEM);
|
|
||||||
goto next;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((ret = av_dynarray_add_nofree(&device_list->devices,
|
if (!new_device->device_name ||
|
||||||
&device_list->nb_devices, new_device)) < 0) {
|
!new_device->device_description ||
|
||||||
|
av_dynarray_add_nofree(&device_list->devices, &device_list->nb_devices, new_device) < 0) {
|
||||||
|
ret = AVERROR(ENOMEM);
|
||||||
av_freep(&new_device->device_name);
|
av_freep(&new_device->device_name);
|
||||||
av_freep(&new_device->device_description);
|
av_freep(&new_device->device_description);
|
||||||
av_freep(&new_device);
|
av_freep(&new_device);
|
||||||
|
Reference in New Issue
Block a user