You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build(msvc): Windows app build stops on C4701/C4703 in obs-scripting-python.c.h:249 (py_s) #3446
The full Windows app build (build-project.yaml, /W4 /WX since #2691) fails on x64 and arm64:
shared\obs-scripting\obs-scripting-python.c.h(249): warning C4701: potentially uninitialized local variable 'py_s' used
shared\obs-scripting\obs-scripting-python.c.h(249): warning C4703: potentially uninitialized local pointer variable 'py_s' used
error C2220: the following warning is treated as an error
Seen in run 41345123078 (job 124966072712), the push run of a release/** branch. PRs never run the full app build, so it went unseen; the scheduled full run and any release branch will stop here. The same class in libobs/obs-video-gpu-encode.c.h (tex_uv) is fixed in #3445. Fix: initialize py_s (check the path that skips its assignment), then look for further C4701s once this one clears.
Investigation confirmed current master still ignores libobs_to_py() in load_python_script(). SWIG_TypeQuery can return NULL without setting py_s; the subsequent Py_BuildValue and Py_XDECREF therefore use an uninitialized pointer. The adjacent get_defaults() already guards conversion.
Ready scope: initialize py_s to NULL, call script_load only on successful settings conversion, and release any conversion output (including Py_None on the other failure path). Preserve the existing load/tick registration and successful callback behavior. Add an executable regression that compiles the actual callback block with conversion stubs: unset output failure and assigned output failure skip the callback; success invokes it and releases references. No existing C tests or public headers change.
Investigation and executable regression plan are documented above. Current master still has the unchecked conversion and the compiler failure; no open PR covers it.
RED: compile the actual callback block with conversion stubs under -O2 -Wall -Wextra -Werror; current master fails with py_s may be used uninitialized. Exercise missing SWIG type, assigned Py_None failure, successful callback and absent callback.
GREEN: initialize the output, invoke script_load only for a successful conversion, and release conversion output in both cases without changing tick registration.
Run focused regression and lint; open a PR this iteration. This is the focused compiler-warning fix, with local RED and GREEN evidence pushed together.
Activity
zackees commentedon Nov 3, 2026
Claiming: investigation of the Python scripting C4701/C4703 failure.
zackees commentedon Nov 3, 2026
Investigation confirmed current master still ignores libobs_to_py() in load_python_script(). SWIG_TypeQuery can return NULL without setting py_s; the subsequent Py_BuildValue and Py_XDECREF therefore use an uninitialized pointer. The adjacent get_defaults() already guards conversion.
Ready scope: initialize py_s to NULL, call script_load only on successful settings conversion, and release any conversion output (including Py_None on the other failure path). Preserve the existing load/tick registration and successful callback behavior. Add an executable regression that compiles the actual callback block with conversion stubs: unset output failure and assigned output failure skip the callback; success invokes it and releases references. No existing C tests or public headers change.
/ready
zackees commentedon Nov 3, 2026
/ready
Investigation and executable regression plan are documented above. Current master still has the unchecked conversion and the compiler failure; no open PR covers it.
zackees commentedon Nov 3, 2026
Claiming: guard script_load settings conversion (#3446).
fix(scripting): guard Python script_load settings conversion (obs-rus…