diff mbox

Problem with em28xx card, PAL and teletext

Message ID AANLkTimgmQzy5sAh_lU_RHYj-ZD9XZavvLmgs7tSNNdZ@mail.gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Devin Heitmueller June 13, 2010, 7:46 p.m. UTC
None
diff mbox

Patch

Fix case where fields were not at the correct start location.

From: Devin Heitmueller <dheitmueller@kernellabs.com>

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

Priority: high

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Eugeniy Meshcheryakov <eugen@debian.org>

diff -r b594029d762f linux/drivers/media/video/em28xx/em28xx-video.c
--- a/linux/drivers/media/video/em28xx/em28xx-video.c	Thu May 13 16:59:15 2010 -0300
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c	Sun Jun 13 15:42:27 2010 -0400
@@ -684,12 +684,12 @@ 
 		}
 
 		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");