[vlc-commits] [Git][videolan/vlc][master] ogg: fix SIGSEGV in case of invalid flac header

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Thu Mar 12 18:45:18 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
db9d19d5 by Thomas Guillem at 2026-03-12T19:02:45+01:00
ogg: fix SIGSEGV in case of invalid flac header

stream was freed and set to NULL in case of invalid flac header.

Backtrace:
```
Thread 22 "vlc-input" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffac3ff6c0 (LWP 855819)]
Ogg_FindLogicalStreams (p_demux=<optimized out>) at ../../modules/demux/ogg.c:1753
1753	                    p_stream->fmt.b_packetized = false;
(gdb) bt
 #0  Ogg_FindLogicalStreams (p_demux=<optimized out>) at ../../modules/demux/ogg.c:1753
 #1  Ogg_BeginningOfStream (p_demux=<optimized out>) at ../../modules/demux/ogg.c:2294
 #2  Demux (p_demux=<optimized out>) at ../../modules/demux/ogg.c:438
 #3  0x00007fffac0e7926 in Open (p_this=0x7fff8c00b540) at ../../modules/demux/ogg.c:271
 #4  0x00007ffff7eab9ba in demux_Probe
    (func=0x7fffac0e7850 <Open>, forced=true, ap=ap at entry=0x7fffac3fe8b0)
    at ../../src/input/demux.c:112
 #5  0x00007ffff7e8af5e in vlc_module_load
    (log=<optimized out>, capability=capability at entry=0x7ffff7f352ff "demux", name=name at entry=0x7fff8c007030 "ext-ogg", strict=strict at entry=false, probe=probe at entry=0x7ffff7eab980 <demux_Probe>) at ../../src/modules/modules.c:230
 #6  0x00007ffff7eabd9c in demux_NewAdvanced
    (p_obj=p_obj at entry=0x5555556fe420, p_input=p_input at entry=0x5555556fe420, module=0x7fff8c007030 "ext-ogg",
    module at entry=0x7fff8c000eb0 "any", url=url at entry=0x7fff8c000ed0 "file:///home/tom/work/git/vlc/build/../../vlc-3.0/poc_flac.ogg", s=<optimized out>, out=out at entry=0x7fff8c000d88, b_preparsing=false) at ../../include/vlc_objects.h:153
 #7  0x00007ffff7ebd12b in InputDemuxNew
    (p_input=0x5555556fe420, p_es_out=0x7fff8c000d88, p_source=0x5555556a9840, url=0x7fff8c000ed0 "file:///home/tom/work/git/vlc/build/../../vlc-3.0/poc_flac.ogg", psz_demux=0x7fff8c000eb0 "any", psz_anchor=<optimized out>) at ../../src/input/input.c:2746
 #8  InputSourceInit
```

- - - - -


1 changed file:

- modules/demux/ogg.c


Changes:

=====================================
modules/demux/ogg.c
=====================================
@@ -1742,6 +1742,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
 
                     es_format_Change( &p_stream->fmt, AUDIO_ES, VLC_CODEC_FLAC );
                     oggpacket.packet += 13; oggpacket.bytes -= 13; /* Point to the streaminfo */
+                    p_stream->fmt.b_packetized = false;
                     if ( !Ogg_ReadFlacStreamInfo( p_demux, p_stream, &oggpacket ) )
                     {
                         msg_Dbg( p_demux, "found invalid Flac header" );
@@ -1750,7 +1751,6 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
                         TAB_ERASE( p_ogg->i_streams, p_ogg->pp_stream,
                                    p_ogg->i_streams - 1 );
                     }
-                    p_stream->fmt.b_packetized = false;
                 }
                 /* Check for Theora header */
                 else if( oggpacket.bytes >= 7 &&



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/db9d19d526c57c8d870b760576ab0ea6d047116b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/db9d19d526c57c8d870b760576ab0ea6d047116b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list