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
Class: integer overflow into allocation size → heap out-of-bounds write, reachable from a user file (Color Grade filter path, also via scene-collection JSON).
load_cube_file (plugins/obs-filters/color-grade-filter.c:192-194) accepts LUT_1D_SIZE %u / LUT_3D_SIZE %u with no bound.
4 * w³ is evaluated in uint32_t and wraps before the sizeof multiply: width = 1024 already yields 4·1024³ = 2³² → data_size = 0; e.g. width = 65536 gives a small nonzero wrap. The nested write loop (:145-161, same for 1D :120-133) iterates width³ voxels and writes 4 struct half entries per voxel — bounded only by get_cube_entry finding another r g b line (:132/:159). Each extra line in the file = 8 more bytes written past the allocation.
So LUT_3D_SIZE 1024 plus N data lines writes ~8·N bytes into bmalloc(0) → deterministic heap corruption. Larger w either crashes immediately or turns filter->cube_width into a huge texture dimension at :261-265.
Fix sketch: parse into size_t, reject w above a sane ceiling (e.g. 256), and compute data_size in size_t with an overflow check before bmalloc.
Activity
obs-filters: Move the .cube LUT loader to cube-lut.c
test/cmocka: Add .cube LUT loader test
obs-filters: Bound .cube LUT sizes before allocating
chriscoveries commentedon Oct 10, 2026
Fixed upstream by #113 (
cube-lut.c: capsLUT_1D_SIZE_MAX 65536/LUT_3D_SIZE_MAX 256,size_tdata_size, cmocka test).obs-filters: Bound color-grade LUT sizes and fix allocation overflow