[vlc-devel] [PATCH] vlc_es: add more documentation on es_format_Copy

Steve Lhomme robux4 at videolabs.io
Wed Jul 12 16:51:19 CEST 2017


It must copy to an unitialized structure or one that was cleaned before.

The result should always be checked as there are allocations that can fail but
it's not safe for now given the state of the rest of the code.
---
 include/vlc_es.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index e9d11d85a8..a428b561c2 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -627,7 +627,10 @@ VLC_API void es_format_InitFromVideo( es_format_t *, const video_format_t * );
 
 /**
  * This functions will copy a es_format_t.
+ *
+ * The destination pointer must be uninitialized or not old any allocated buffer.
  */
+/* VLC_USED for now we're okay with losing strings and extradata */
 VLC_API int es_format_Copy( es_format_t *p_dst, const es_format_t *p_src );
 
 /**
-- 
2.12.1



More information about the vlc-devel mailing list