Skip to content

Commit

Permalink
V4L/DVB: Fix case where fields were not at the correct start location
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Aug 2, 2010
1 parent 7f8eacd commit 2584bc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 2584bc4

Please sign in to comment.