mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 16:52:31 +00:00
lavd/v4l2: reduce variable scope
device and cap are local to the loop iteration, there is no need for them to retain their values. Especially for device it may be dangerous, since it points to av_malloc'ed data.
This commit is contained in:
parent
e1151fbf22
commit
b532ca3d2f
@ -1019,8 +1019,6 @@ static int v4l2_get_device_list(AVFormatContext *ctx, AVDeviceInfoList *device_l
|
|||||||
struct video_data *s = ctx->priv_data;
|
struct video_data *s = ctx->priv_data;
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
struct dirent *entry;
|
struct dirent *entry;
|
||||||
AVDeviceInfo *device = NULL;
|
|
||||||
struct v4l2_capability cap;
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!device_list)
|
if (!device_list)
|
||||||
@ -1033,6 +1031,8 @@ static int v4l2_get_device_list(AVFormatContext *ctx, AVDeviceInfoList *device_l
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
while ((entry = readdir(dir))) {
|
while ((entry = readdir(dir))) {
|
||||||
|
AVDeviceInfo *device = NULL;
|
||||||
|
struct v4l2_capability cap;
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
char device_name[256];
|
char device_name[256];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user