[vlc-commits] magnify: fix wrong colors if visible_pitch != pitch

Thomas Guillem git at videolan.org
Fri Mar 9 16:18:17 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Mar  9 15:41:19 2018 +0100| [f51cb8312ae041e681b5a62aabe7dde034be6563] | committer: Thomas Guillem

magnify: fix wrong colors if visible_pitch != pitch

Fixes #19951

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f51cb8312ae041e681b5a62aabe7dde034be6563
---

 modules/video_filter/magnify.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/video_filter/magnify.c b/modules/video_filter/magnify.c
index 9edd627983..4b667c6206 100644
--- a/modules/video_filter/magnify.c
+++ b/modules/video_filter/magnify.c
@@ -186,7 +186,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
             const int o_yp = o_y * p_outpic->p[i_plane].i_visible_lines / p_outpic->p[Y_PLANE].i_visible_lines;
             const int o_xp = o_x * p_outpic->p[i_plane].i_visible_pitch / p_outpic->p[Y_PLANE].i_visible_pitch;
 
-            p_pic->p[i_plane].p_pixels += o_yp * p_pic->p[i_plane].i_visible_pitch + o_xp;
+            p_pic->p[i_plane].p_pixels += o_yp * p_pic->p[i_plane].i_pitch + o_xp;
         }
 
         /* */
@@ -230,7 +230,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
         v_w = __MIN( fmt_out.i_visible_width  * ZOOM_FACTOR / o_zoom, fmt_out.i_visible_width - 1 );
         v_h = __MIN( fmt_out.i_visible_height * ZOOM_FACTOR / o_zoom, fmt_out.i_visible_height - 1 );
 
-        DrawRectangle( p_oyp->p_pixels, p_oyp->i_visible_pitch,
+        DrawRectangle( p_oyp->p_pixels, p_oyp->i_pitch,
                        p_oyp->i_visible_pitch, p_oyp->i_visible_lines,
                        o_x/VIS_ZOOM, o_y/VIS_ZOOM,
                        v_w, v_h );



More information about the vlc-commits mailing list