Skip to content

Segmentation fault in vorbis_analysis_wrote on Windows #117

@dragon-archer

Description

@dragon-archer

Hello, I've noticed a segmentation fault inside vorbis_analysis_wrote, here is a minimal reproducible example

// test.cpp
// compiled with: clang++ test.cpp -o test.exe -lvorbis -lvorbisenc
#include <vorbis/vorbisenc.h>

int main() {
	const int size = 260000; // 250000 will be ok

	vorbis_info      vi;
	vorbis_dsp_state vd;

	vorbis_info_init(&vi);
	vorbis_encode_init_vbr(&vi, 2, 44100, 0.5f);
	vorbis_analysis_init(&vd, &vi);

	float** buffer = vorbis_analysis_buffer(&vd, size);

	vorbis_analysis_wrote(&vd, size); // seg faults here

	vorbis_dsp_clear(&vd);
	vorbis_info_clear(&vi);

	return 0;
}

I've tried to use gdb, and the backtrace is like below

#0  0x00007ff805283a6e in ___chkstk_ms () from E:\msys64\clang64\bin\libvorbis-0.dll
#1  0x00000000000fee80 in ?? ()
#2  0x000000000014fdf0 in ?? ()
#3  0x00007ff80526e0ac in vorbis_analysis_wrote () from E:\msys64\clang64\bin\libvorbis-0.dll
#4  0x00007ff80526df0c in vorbis_analysis_wrote () from E:\msys64\clang64\bin\libvorbis-0.dll
#5  0x00007ff6f2d01495 in main ()

I'm using libvorbis v1.3.7-2 from package mingw-w64-clang-x86_64-libvorbis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions