[vlc-commits] smem: do not clobber pixels matrix pointer (fixes #7767)

Rémi Denis-Courmont git at videolan.org
Fri Nov 16 16:34:43 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 16 17:34:09 2012 +0200| [e007b1d4081ac87a5a3a9e13badc149a43b42e45] | committer: Rémi Denis-Courmont

smem: do not clobber pixels matrix pointer (fixes #7767)

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

 modules/stream_out/smem.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/smem.c b/modules/stream_out/smem.c
index e674f790..f69b6c6 100644
--- a/modules/stream_out/smem.c
+++ b/modules/stream_out/smem.c
@@ -363,8 +363,15 @@ static int SendVideo( sout_stream_t *p_stream, sout_stream_id_t *id,
     /* Copying data into user buffer */
     if( id->format->video.i_bits_per_pixel > 0 )
     {
-        for ( int line = 0; line < i_line; line++, p_pixels += i_line_size )
-            memcpy( p_pixels, p_buffer->p_buffer + i_line_size * line , i_line_size );
+        uint8_t *p_in = p_buffer->p_buffer;
+        uint8_t *p_out = p_pixels;
+
+        for ( int line = 0; line < i_line; line++ )
+        {
+            memcpy( p_out, p_in, i_line_size );
+            p_out += i_line_size;
+            p_in += i_line_size;
+        }
     }
     else
     {



More information about the vlc-commits mailing list