From 60821232b9463ae00a6c2a0506f5be1bca8d8ef5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 7 Jul 2018 13:25:01 +0200 Subject: [PATCH] decoder/audiofile: allocate AFvirtualfile with malloc() afCloseFile() uses free(), so we need to use malloc(). --- src/decoder/plugins/AudiofileDecoderPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decoder/plugins/AudiofileDecoderPlugin.cxx b/src/decoder/plugins/AudiofileDecoderPlugin.cxx index 6a555abaf..3f2ee77c0 100644 --- a/src/decoder/plugins/AudiofileDecoderPlugin.cxx +++ b/src/decoder/plugins/AudiofileDecoderPlugin.cxx @@ -129,7 +129,7 @@ audiofile_file_seek(AFvirtualfile *vfile, AFfileoffset _offset, static AFvirtualfile * setup_virtual_fops(AudioFileInputStream &afis) noexcept { - AFvirtualfile *vf = new AFvirtualfile(); + AFvirtualfile *vf = (AFvirtualfile *)malloc(sizeof(*vf)); vf->closure = &afis; vf->write = nullptr; vf->read = audiofile_file_read;