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
616 }616 }
617 617
618 desired_format = device_try_init(s1, ap, &s->width, &s->height, &codec_id);618 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
622 if (desired_format == 0) {619 if (desired_format == 0) {
623 av_log(s1, AV_LOG_ERROR, "Cannot find a proper format for "620 av_log(s1, AV_LOG_ERROR, "Cannot find a proper format for "
624 "codec_id %d, pix_fmt %d.\n", s1->video_codec_id, ap->pix_fmt);621 "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
626 623
627 return AVERROR(EIO);624 return AVERROR(EIO);
628 }625 }
626 if (avcodec_check_dimensions(s1, s->width, s->height) < 0)
627 return AVERROR(EINVAL);
629 s->frame_format = desired_format;628 s->frame_format = desired_format;
630 629
631 if( v4l2_set_parameters( s1, ap ) < 0 )630 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