Skip to content

test: test_ffmpeg_mux_write_packet leaks its packet buffer (LeakSanitizer, valgrind) #3400

Closed

Description

@vpacher

What happens

test_ffmpeg_mux_write_packet (#3361) leaks the 64 KiB packet buffer that write_packet() keeps in stream->packet_buf:

Direct leak of 66064 byte(s) in 2 object(s) allocated from:
    #2 darray_ensure_capacity libobs/util/darray.h:107
    #4 write_packet plugins/obs-ffmpeg/obs-ffmpeg-mux.c.h:624
    #5 run test/cmocka/test_ffmpeg_mux_write_packet.c:67

The asan job reports it (run 41287610997) and valgrind does too (exit 99, 66,064 bytes definitely lost). Tier 2 passes, as it does not check for leaks.

OBS itself does not leak: ffmpeg_mux_destroy() frees the buffer. The test's stream is on the stack and never goes through ffmpeg_mux_destroy().

What to do

Free stream.packet_buf at the end of run(). No assertion changes.

Once #3290 lands, the asan job fails on a sanitizer report, so this must be fixed first.

Activity

  1. added
    quality
    P2
    size:S
    on Nov 1, 2026
  2. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    /ready

  3. added
    ready
    on Nov 1, 2026
  4. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    Claiming: free the packet buffer in test_ffmpeg_mux_write_packet

    Plan (one PR): free stream.packet_buf at the end of run(); valgrind evidence before and after. PR within the hour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2qualityreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions