[vlc-devel] [PATCH] cache: ensure the stat types we read/write are the same sizes

Steve Lhomme robux4 at videolabs.io
Wed Oct 12 08:34:51 CEST 2016


---
 src/modules/cache.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/modules/cache.c b/src/modules/cache.c
index a08496d..a2191c1 100644
--- a/src/modules/cache.c
+++ b/src/modules/cache.c
@@ -380,6 +380,8 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
         LOAD_STRING(path);
         if (path == NULL)
             goto error;
+        static_assert(sizeof(st.st_mtime) == sizeof(cache->mtime), "time mismatch");
+        static_assert(sizeof(st.st_size)  == sizeof(cache->size),  "size mismatch");
         LOAD_IMMEDIATE(st.st_mtime);
         LOAD_IMMEDIATE(st.st_size);
 
-- 
2.8.2



More information about the vlc-devel mailing list