[libdvdnav-devel] [Git][videolan/libdvdread][master] 2 commits: file_win32: verify the size of off_t/off64_t is 64-bit as expected
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Wed Aug 5 15:30:52 UTC 2026
Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdread
Commits:
2bfbd8de by Steve Lhomme at 2026-08-05T17:24:17+02:00
file_win32: verify the size of off_t/off64_t is 64-bit as expected
Similar to 96c98740abd2aeb53e9a562fcb586793dcb8c6bd for Windows.
- - - - -
3a1a0727 by Steve Lhomme at 2026-08-05T17:24:17+02:00
file_posix: be more explicit about the bogus off_t/off64_t bogus sizes
- - - - -
2 changed files:
- src/file/file_posix.c
- src/file/file_win32.c
Changes:
=====================================
src/file/file_posix.c
=====================================
@@ -42,9 +42,11 @@
#include "filesystem.h"
// verify the off64_t from dvd_filesystem.h has the proper size
-static_assert(sizeof(off64_t) >= (64/8), "Bogus off64_t size");
+static_assert(sizeof(off64_t) <= (64/8), "off64_t bigger than 64 bits");
+static_assert(sizeof(off64_t) >= (64/8), "off64_t smaller than 64 bits");
// verify the off_t from dvd_filesystem.h has the proper size
-static_assert(sizeof(off_t) >= (64/8), "Bogus off_t size");
+static_assert(sizeof(off_t) <= (64/8), "off_t bigger than 64 bits");
+static_assert(sizeof(off_t) >= (64/8), "off_t smaller than 64 bits");
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
defined(__NetBSD__) || defined(__DragonFly__) || defined (__wasm__) || \
=====================================
src/file/file_win32.c
=====================================
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <assert.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -36,6 +37,12 @@
#include <dvdread/dvd_filesystem.h>
#include "filesystem.h"
+// verify the off64_t from dvd_filesystem.h has the proper size
+static_assert(sizeof(off64_t) <= (64/8), "off64_t bigger than 64 bits");
+static_assert(sizeof(off64_t) >= (64/8), "off64_t smaller than 64 bits");
+// verify the off_t from dvd_filesystem.h has the proper size
+static_assert(sizeof(off_t) <= (64/8), "off_t bigger than 64 bits");
+static_assert(sizeof(off_t) >= (64/8), "off_t smaller than 64 bits");
static void *file_open_default(dvd_reader_filesystem_h *fs, const char* filename)
{
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/21ba2d465e6edb5033a90668882492b727724430...3a1a072755a121d418359964f27451c28d9853e8
--
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/21ba2d465e6edb5033a90668882492b727724430...3a1a072755a121d418359964f27451c28d9853e8
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the libdvdnav-devel
mailing list