summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2010-06-13 17:00:23 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 14:49:04 -0300
commit2584bc4337855382d23b4abfc2e2492df6fdeb41 (patch)
tree35fb9a392cc369ccecb79212220a2fe837f599ac /drivers/media/video/em28xx
parent7f8eacd2162a39ca7fc1240883118a786f147ccb (diff)
downloadblackbird-op-linux-2584bc4337855382d23b4abfc2e2492df6fdeb41.tar.gz
blackbird-op-linux-2584bc4337855382d23b4abfc2e2492df6fdeb41.zip
V4L/DVB: Fix case where fields were not at the correct start location
This patch address an arithmetic error for the case where the only remaining content in the USB packet was the "225Axxxx" start of active video. In cases where that happened to be at the end of the frame, we would inject it into the videobuf (which is incorrect). This caused fields to be intermittently rendered off by two pixels. Thanks to Eugeniy Meshcheryakov for bringing this issue to my attention Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 20090e34173a..7b9ec6e493e4 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -654,12 +654,12 @@ static inline int em28xx_isoc_copy_vbi(struct em28xx *dev, struct urb *urb)
}
if (buf != NULL && dev->capture_type == 2) {
- if (len > 4 && p[0] == 0x88 && p[1] == 0x88 &&
+ if (len >= 4 && p[0] == 0x88 && p[1] == 0x88 &&
p[2] == 0x88 && p[3] == 0x88) {
p += 4;
len -= 4;
}
- if (len > 4 && p[0] == 0x22 && p[1] == 0x5a) {
+ if (len >= 4 && p[0] == 0x22 && p[1] == 0x5a) {
em28xx_isocdbg("Video frame %d, len=%i, %s\n",
p[2], len, (p[2] & 1) ?
"odd" : "even");
OpenPOWER on IntegriCloud