[vlc-devel] commit: Added a missing const to video_format_Copy. (Laurent Aimar )

git version control git at videolan.org
Sat Jun 6 19:59:09 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Jun  6 15:51:26 2009 +0200| [a65e5abc5bb148264ccfb3323ac6a94d8ea0351d] | committer: Laurent Aimar 

Added a missing const to video_format_Copy.

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

 include/vlc_es.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index 7c5846f..3a98214 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -147,15 +147,15 @@ static inline void video_format_Init( video_format_t *p_src, vlc_fourcc_t i_chro
  * \param p_dst video_format_t to copy to
  * \param p_src video_format_t to copy from
  */
-static inline int video_format_Copy( video_format_t *p_dst, video_format_t *p_src )
+static inline int video_format_Copy( video_format_t *p_dst, const video_format_t *p_src )
 {
-    memcpy( p_dst, p_src, sizeof( video_format_t ) );
+    memcpy( p_dst, p_src, sizeof( *p_dst ) );
     if( p_src->p_palette )
     {
         p_dst->p_palette = (video_palette_t *) malloc( sizeof( video_palette_t ) );
         if( !p_dst->p_palette )
             return VLC_ENOMEM;
-        memcpy( p_dst->p_palette, p_src->p_palette, sizeof( video_palette_t ) );
+        memcpy( p_dst->p_palette, p_src->p_palette, sizeof( *p_dst->p_palette ) );
     }
     return VLC_SUCCESS;
 };




More information about the vlc-devel mailing list