History

Check the return value of device_try_init() immediately after calling such a function. Avoids the following warning: libavdevice/v4l2.c: In function ‘v4l2_read_header’: libavdevice/v4l2.c:586: warning: ‘codec_id’ may be used uninitialized in this function

Originally committed as revision 22986 to svn://svn.ffmpeg.org/ffmpeg/trunk

Luca Abeni committed 16 years ago

Commit b01dba11 parent 337104a1 file · +2 −3Browse files

Unified · Split

libavdevice/v4l2.c+2−3
@@ -616,9 +616,6 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 615 unmodified lines
616616 }
617617
618618 desired_format = device_try_init(s1, ap, &s->width, &s->height, &codec_id);
619− if (avcodec_check_dimensions(s1, s->width, s->height) < 0)
620− return AVERROR(EINVAL);
621−
622619 if (desired_format == 0) {
623620 av_log(s1, AV_LOG_ERROR, "Cannot find a proper format for "
624621 "codec_id %d, pix_fmt %d.\n", s1->video_codec_id, ap->pix_fmt);
@@ -626,6 +623,8 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 1 unmodified line
626623
627624 return AVERROR(EIO);
628625 }
626+ if (avcodec_check_dimensions(s1, s->width, s->height) < 0)
627+ return AVERROR(EINVAL);
629628 s->frame_format = desired_format;
630629
631630 if( v4l2_set_parameters( s1, ap ) < 0 )

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t