mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
2de26c0a4a
The bttv driver function which handles switching of the video standard (set_tvnorm() in bttv-driver.c) includes a check which can optionally also reset the cropping configuration to a default value. It is "optional" based on a comparison of the cropcap parameters of the previous vs the newly requested video standard. The comparison is being done with a memcmp(), a function which only returns a true value if the comparison actually fails. This if-statement appears to have been written to assume wrong memcmp() semantics. That is, it was re-initializing the cropping configuration only if the new video standard did NOT have different cropcap values. That doesn't make any sense. One definitely should reset things if the cropcap parameters are different - if there's any comparison to made at all. The effect of this problem was that a transition from, say, PAL to NTSC would leave in place old cropping setup that made sense for the PAL geometry but not for NTSC. If the application doesn't care about cropping it also won't try to reset the cropping configuration, resulting in an improperly cropped video frame. In the case I was testing this actually caused black video frames to be displayed. Another interesting effect of this bug is that if one does something which does NOT change the video standard and this function is run, then the cropping setup gets reset anyway - again because of the backwards comparison. It turns out that just running anything which merely opens and closes the video device node (e.g. v4l-info) will cause this to happen. One can argue that simply opening the device node and not doing anything to it should not mess with any of its state - but because of this behavior, any TV app which does such things (e.g. xawtv) probably therefore doesn't see the problem. The solution is to fix the sense of the if-statement. It's easy to see how this mistake could have been made given how memcmp() works. The patch is therefore removal of a single "!" character from the if-statement in set_tvnorm in bttv-driver.c. Signed-off-by: Mike Isely <isely@pobox.com> CC: stable@kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> |
||
---|---|---|
.. | ||
au0828 | ||
bt8xx | ||
cpia2 | ||
cx18 | ||
cx88 | ||
cx231xx | ||
cx23885 | ||
cx25840 | ||
davinci | ||
em28xx | ||
et61x251 | ||
gspca | ||
hdpvr | ||
ivtv | ||
ovcamchip | ||
pvrusb2 | ||
pwc | ||
saa7134 | ||
saa7164 | ||
sn9c102 | ||
usbvideo | ||
usbvision | ||
uvc | ||
zc0301 | ||
zoran | ||
adv7170.c | ||
adv7175.c | ||
adv7180.c | ||
adv7343.c | ||
adv7343_regs.h | ||
arv.c | ||
bt819.c | ||
bt856.c | ||
bt866.c | ||
btcx-risc.c | ||
btcx-risc.h | ||
bw-qcam.c | ||
bw-qcam.h | ||
c-qcam.c | ||
cafe_ccic-regs.h | ||
cafe_ccic.c | ||
cpia.c | ||
cpia.h | ||
cpia_pp.c | ||
cpia_usb.c | ||
cs53l32a.c | ||
cs5345.c | ||
cs8420.h | ||
cx2341x.c | ||
dabusb.c | ||
dabusb.h | ||
font.h | ||
hexium_gemini.c | ||
hexium_orion.c | ||
ibmmpeg2.h | ||
indycam.c | ||
indycam.h | ||
ir-kbd-i2c.c | ||
Kconfig | ||
ks0127.c | ||
ks0127.h | ||
m52790.c | ||
Makefile | ||
meye.c | ||
meye.h | ||
msp3400-driver.c | ||
msp3400-driver.h | ||
msp3400-kthreads.c | ||
mt9m001.c | ||
mt9m111.c | ||
mt9t031.c | ||
mt9v011.c | ||
mt9v011.h | ||
mt9v022.c | ||
mx1_camera.c | ||
mx3_camera.c | ||
mxb.c | ||
mxb.h | ||
omap24xxcam-dma.c | ||
omap24xxcam.c | ||
omap24xxcam.h | ||
ov511.c | ||
ov511.h | ||
ov772x.c | ||
ov7670.c | ||
pms.c | ||
pxa_camera.c | ||
s2255drv.c | ||
saa711x_regs.h | ||
saa717x.c | ||
saa5246a.c | ||
saa5249.c | ||
saa6588.c | ||
saa7110.c | ||
saa7115.c | ||
saa7121.h | ||
saa7127.c | ||
saa7146.h | ||
saa7146reg.h | ||
saa7185.c | ||
saa7191.c | ||
saa7191.h | ||
se401.c | ||
se401.h | ||
sh_mobile_ceu_camera.c | ||
soc_camera.c | ||
soc_camera_platform.c | ||
stk-sensor.c | ||
stk-webcam.c | ||
stk-webcam.h | ||
stradis.c | ||
stv680.c | ||
stv680.h | ||
tcm825x.c | ||
tcm825x.h | ||
tda7432.c | ||
tda9840.c | ||
tda9875.c | ||
tea6415c.c | ||
tea6415c.h | ||
tea6420.c | ||
tea6420.h | ||
ths7303.c | ||
tlv320aic23b.c | ||
tuner-core.c | ||
tvaudio.c | ||
tveeprom.c | ||
tvp514x.c | ||
tvp514x_regs.h | ||
tvp5150.c | ||
tvp5150_reg.h | ||
tw9910.c | ||
upd64031a.c | ||
upd64083.c | ||
v4l1-compat.c | ||
v4l2-common.c | ||
v4l2-compat-ioctl32.c | ||
v4l2-dev.c | ||
v4l2-device.c | ||
v4l2-int-device.c | ||
v4l2-ioctl.c | ||
videobuf-core.c | ||
videobuf-dma-contig.c | ||
videobuf-dma-sg.c | ||
videobuf-dvb.c | ||
videobuf-vmalloc.c | ||
vino.c | ||
vino.h | ||
vivi.c | ||
vp27smpx.c | ||
vpx3220.c | ||
w9966.c | ||
w9968cf.c | ||
w9968cf.h | ||
w9968cf_decoder.h | ||
w9968cf_vpp.h | ||
wm8739.c | ||
wm8775.c | ||
zr364xx.c |