]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Fix VIDIOC_ENUMSTD bug
authorJonathan Corbet <corbet-v4l@lwn.net>
Mon, 25 Sep 2006 23:25:37 +0000 (16:25 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 Oct 2006 20:23:26 +0000 (13:23 -0700)
commitd3d1445e23803ea576aa8b77beb8dfa6066bb6dc
tree02ec6c79c5391a1df673901b99768ccc400813ad
parentfad2a56d330427a5983d3fa57690ee5dc36c17bf
Fix VIDIOC_ENUMSTD bug

The v4l2 API documentation for VIDIOC_ENUMSTD says:

To enumerate all standards applications shall begin at index
zero, incrementing by one until the driver returns EINVAL.

The actual code, however, tests the index this way:

               if (index<=0 || index >= vfd->tvnormsize) {
                        ret=-EINVAL;

So any application which passes in index=0 gets EINVAL right off the bat
- and, in fact, this is what happens to mplayer.  So I think the
following patch is called for, and maybe even appropriate for a 2.6.18.x
stable release.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/media/video/videodev.c