[vlc-commits] opengl: fix temporary buf visible_pitch alignment

Thomas Guillem git at videolan.org
Wed Apr 18 16:17:04 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Apr 18 16:13:57 2018 +0200| [7f2cc34ce2def321ae6c08475150ccdacbc16d6a] | committer: Thomas Guillem

opengl: fix temporary buf visible_pitch alignment

This commit fixes a regression from 22776daa29914cf56c346241f89682d5707ffef7

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

 modules/video_output/opengl/converter_sw.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/video_output/opengl/converter_sw.c b/modules/video_output/opengl/converter_sw.c
index 1a27048272..981e0d4e37 100644
--- a/modules/video_output/opengl/converter_sw.c
+++ b/modules/video_output/opengl/converter_sw.c
@@ -447,6 +447,9 @@ upload_plane(const opengl_tex_converter_t *tc, unsigned tex_idx,
     {
         if (pitch != visible_pitch)
         {
+#define ALIGN(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
+            visible_pitch = ALIGN(visible_pitch, 4);
+#undef ALIGN
             size_t buf_size = visible_pitch * height;
             const uint8_t *source = pixels;
             uint8_t *destination;



More information about the vlc-commits mailing list