]> git.sesse.net Git - vlc/commitdiff
* modules/video_filter/scale.c: Fixed bug reported by Wallace Wadge (wwadge at gmail).
authorGildas Bazin <gbazin@videolan.org>
Sun, 11 Sep 2005 16:57:10 +0000 (16:57 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 11 Sep 2005 16:57:10 +0000 (16:57 +0000)
modules/video_filter/scale.c

index 7b1beea5a0a8577b89ecf2ce18a7e1e91c4eea84..d9d0799fd0e7d2347fa72c504a465ea91460596f 100644 (file)
@@ -133,12 +133,16 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
                   p_filter->fmt_out.video.i_height / 2 ) /
                 p_filter->fmt_out.video.i_height;
 
+            l = __MIN( (int)p_filter->fmt_in.video.i_height - 1, l );
+
             for( j = 0; j < p_pic_dst->p[i_plane].i_visible_pitch; j++ )
             {
                 k = ( p_filter->fmt_in.video.i_width * j +
                       p_filter->fmt_out.video.i_width / 2 ) /
                     p_filter->fmt_out.video.i_width;
 
+                k = __MIN( (int)p_filter->fmt_in.video.i_width - 1, k );
+
                 p_dst[i * i_dst_pitch + j] = p_src[l * i_src_pitch + k];
             }
         }