fix: move VBI_DEBUG to CMake opt-in, fix MSVC empty struct error (#2168)

- Remove unconditional #define VBI_DEBUG from ccx_decoders_vbi.h
- Add CMake option VBI_DEBUG (OFF by default) in src/CMakeLists.txt
- Use #ifdef VBI_DEBUG / #else for debug_file_name vs reserved member,
  preventing MSVC C2016 empty struct error in non-debug builds
- Add changelog entry in docs/CHANGES.TXT under 0.96.7 unreleased

Fixes #2167
This commit is contained in:
Varad Raj Agrawal
2026-03-13 07:17:43 +05:30
committed by GitHub
parent d0c73362ed
commit dc1d8d9592
3 changed files with 11 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
0.96.7 (unreleased)
-------------------
- Fix: Remove unconditional VBI_DEBUG define — add CMake option -DVBI_DEBUG=ON for opt-in debug builds (#2167)
- Fix: Remove strdup() memory leaks in WebVTT styling encoder, fix invalid CSS rgba(0,256,0) green value, fix missing free(unescaped) on write-error path (#2154)
- Fix: Prevent crash in Rust timing module when logging out-of-range PTS/FTS timestamps from malformed streams.

View File

@@ -1,11 +1,11 @@
cmake_minimum_required (VERSION 3.24.0)
project (CCExtractor)
include (CTest)
option (WITH_FFMPEG "Build using FFmpeg demuxer and decoder" OFF)
option (WITH_OCR "Build with OCR (Optical Character Recognition) feature" OFF)
option (WITH_HARDSUBX "Build with support for burned-in subtitles" OFF)
option (VBI_DEBUG "Enable VBI decoder debug output" OFF)
# Version number
set (CCEXTRACTOR_VERSION_MAJOR 0)
@@ -145,6 +145,11 @@ else (MSVC)
endif(MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64")
if (VBI_DEBUG)
add_definitions(-DVBI_DEBUG)
message(STATUS "VBI debug output enabled")
endif (VBI_DEBUG)
add_subdirectory (lib_ccx)
aux_source_directory(${PROJECT_SOURCE_DIR} SOURCEFILE)
@@ -243,6 +248,7 @@ if (PKG_CONFIG_FOUND AND WITH_HARDSUBX)
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${LEPTONICA_INCLUDE_DIRS})
endif (PKG_CONFIG_FOUND AND WITH_HARDSUBX)
add_executable (ccextractor ${SOURCEFILE} ${FREETYPE_SOURCE} ${UTF8PROC_SOURCE})
########################################################

View File

@@ -2,7 +2,6 @@
#define CCX_DECODER_VBI
#include "zvbi/zvbi_decoder.h"
#define VBI_DEBUG
#include "ccx_decoders_structs.h"
#include "ccx_decoders_common.h"
@@ -11,6 +10,8 @@ struct ccx_decoder_vbi_cfg
{
#ifdef VBI_DEBUG
char *debug_file_name;
#else
int reserved; /* ensure non-empty struct in non-debug builds (MSVC C2016) */
#endif
};
@@ -24,4 +25,4 @@ struct ccx_decoder_vbi_ctx
#endif
};
#endif
#endif