mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 08:12:44 +00:00
lavd/v4l2: fix error logic when enumerating standards
Set ret to 0 before enumerating standards in v4l2_set_parameters(), avoid
use of uninitialized variable.
Regression introduced in 60950adc18
.
This commit is contained in:
parent
0e3dacb11e
commit
f0703b6cba
@ -679,13 +679,16 @@ static int v4l2_set_parameters(AVFormatContext *s1)
|
||||
|
||||
if (s->standard) {
|
||||
if (s->std_id) {
|
||||
ret = 0;
|
||||
av_log(s1, AV_LOG_DEBUG, "Setting standard: %s\n", s->standard);
|
||||
/* set tv standard */
|
||||
for (i = 0; ; i++) {
|
||||
standard.index = i;
|
||||
if (v4l2_ioctl(s->fd, VIDIOC_ENUMSTD, &standard) < 0)
|
||||
if (v4l2_ioctl(s->fd, VIDIOC_ENUMSTD, &standard) < 0) {
|
||||
ret = AVERROR(errno);
|
||||
if (ret < 0 || !av_strcasecmp(standard.name, s->standard))
|
||||
break;
|
||||
}
|
||||
if (!av_strcasecmp(standard.name, s->standard))
|
||||
break;
|
||||
}
|
||||
if (ret < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user