]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] VIDIOC_ENUMSTD bug
authorJonathan Corbet <corbet-v4l@lwn.net>
Mon, 25 Sep 2006 23:25:37 +0000 (16:25 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 26 Sep 2006 00:38:36 +0000 (17:38 -0700)
commit46902aa840e5602db69652a1ecd99acf3c158012
treec9420517d6a133121d13395dd21b729e6b26f40a
parenta8fb00b4a9b9c5f2f5b25696e0a417e766625f35
[PATCH] 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>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/media/video/videodev.c