Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b4b38bd63c07c8927b43c6c378eca1db10fdaf2e
Commit:     b4b38bd63c07c8927b43c6c378eca1db10fdaf2e
Parent:     813ce47cee33964ff710d2c91063548773cb4cd5
Author:     Ian Armstrong <[EMAIL PROTECTED]>
AuthorDate: Fri Aug 3 09:44:13 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 22:04:25 2007 -0300

    V4L/DVB (5970): ivtv: prevent vertical overflow of yuv output
    
    When the video standard is changed, there's no guarantee the framebuffer
    dimensions are still legal. The yuv output code uses these dimensions to
    calculate the size & position for the video overlay. If the framebuffer
    dimensions are now illegal, the output may exceed the vertical limit of the
    display, causing distortion.
    
    This patch adds an additional check to ensure the output doesn't exceed
    the limits for the current video standard, cropping if required.
    
    Signed-off-by: Ian Armstrong <[EMAIL PROTECTED]>
    Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/ivtv/ivtv-yuv.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-yuv.c 
b/drivers/media/video/ivtv/ivtv-yuv.c
index bcea095..70ddf40 100644
--- a/drivers/media/video/ivtv/ivtv-yuv.c
+++ b/drivers/media/video/ivtv/ivtv-yuv.c
@@ -898,8 +898,21 @@ static void ivtv_yuv_init (struct ivtv *itv)
                itv->yuv_info.decode_height = 480;
 
        /* If no visible size set, assume full size */
-       if (!itv->yuv_info.osd_vis_w) itv->yuv_info.osd_vis_w = 720 - 
itv->yuv_info.osd_x_offset;
-       if (!itv->yuv_info.osd_vis_h) itv->yuv_info.osd_vis_h = 
itv->yuv_info.decode_height - itv->yuv_info.osd_y_offset;
+       if (!itv->yuv_info.osd_vis_w)
+               itv->yuv_info.osd_vis_w = 720 - itv->yuv_info.osd_x_offset;
+
+       if (!itv->yuv_info.osd_vis_h) {
+               itv->yuv_info.osd_vis_h = itv->yuv_info.decode_height - 
itv->yuv_info.osd_y_offset;
+       } else {
+               /* If output video standard has changed, requested height may
+               not be legal */
+               if (itv->yuv_info.osd_vis_h + itv->yuv_info.osd_y_offset > 
itv->yuv_info.decode_height) {
+                       IVTV_DEBUG_WARN("Clipping yuv output - fb size (%d) 
exceeds video standard limit (%d)\n",
+                                       itv->yuv_info.osd_vis_h + 
itv->yuv_info.osd_y_offset,
+                                       itv->yuv_info.decode_height);
+                       itv->yuv_info.osd_vis_h = itv->yuv_info.decode_height - 
itv->yuv_info.osd_y_offset;
+               }
+       }
 
        /* We need a buffer for blanking when Y plane is offset - non-fatal if 
we can't get one */
        itv->yuv_info.blanking_ptr = kzalloc(720*16,GFP_KERNEL);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to