• Jonathan Corbet's avatar
    [PATCH] VIDIOC_ENUMSTD bug · b7de567b
    Jonathan Corbet authored
    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: default avatarJonathan Corbet <corbet@lwn.net>
    Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
    Cc: <stable@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    b7de567b
videodev.c 39.1 KB