From aafabf236797e45385b7b469961c6fe10bf7d1aa Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Thu, 19 Dec 2024 09:33:01 -0800 Subject: [PATCH] Ensure MP3 can safely exit on OOM (#716) Fixes #715. Good catch, @EternityForest --- src/AudioGeneratorMP3.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/AudioGeneratorMP3.cpp b/src/AudioGeneratorMP3.cpp index 36c93ba5..4aa8b250 100644 --- a/src/AudioGeneratorMP3.cpp +++ b/src/AudioGeneratorMP3.cpp @@ -27,6 +27,9 @@ AudioGeneratorMP3::AudioGeneratorMP3() file = NULL; output = NULL; buff = NULL; + synth = NULL; + frame = NULL; + stream = NULL; nsCountMax = 1152/32; madInitted = false; } @@ -37,6 +40,9 @@ AudioGeneratorMP3::AudioGeneratorMP3(void *space, int size): preallocateSpace(sp file = NULL; output = NULL; buff = NULL; + synth = NULL; + frame = NULL; + stream = NULL; nsCountMax = 1152/32; madInitted = false; } @@ -51,6 +57,9 @@ AudioGeneratorMP3::AudioGeneratorMP3(void *buff, int buffSize, void *stream, int file = NULL; output = NULL; buff = NULL; + synth = NULL; + frame = NULL; + stream = NULL; nsCountMax = 1152/32; madInitted = false; }