diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2008-12-28 17:41:19 +0300 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2008-12-28 17:41:19 +0300 |
commit | 5d91e9285339acaea7daf9e76932d5237cc771df (patch) | |
tree | c962860761513a47ef81ef4b047cc197099ebd4d /libavdevice/v4l.c | |
parent | ade8fb4d758977345df6d7e1c55a6cdc0394e019 (diff) |
Use avcodec_check_dimensions() for checking the frame size validity.
The v4l.c check is moved after the eventual automatic size detection,
so the check in that case is performed on the new set values.
Originally committed as revision 16370 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavdevice/v4l.c')
-rw-r--r-- | libavdevice/v4l.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c index 39844a913c..c2c67d0516 100644 --- a/libavdevice/v4l.c +++ b/libavdevice/v4l.c @@ -84,11 +84,6 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) } s->time_base = ap->time_base; - if((unsigned)ap->width > 32767 || (unsigned)ap->height > 32767) { - av_log(s1, AV_LOG_ERROR, "Capture size is out of range: %dx%d\n", - ap->width, ap->height); - return -1; - } s->video_win.width = ap->width; s->video_win.height = ap->height; @@ -121,6 +116,9 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) } } + if(avcodec_check_dimensions(s1, s->video_win.width, s->video_win.height) < 0) + return -1; + desired_palette = -1; desired_depth = -1; for (j = 0; j < vformat_num; j++) { |