Skip to content

Commit aafabf2

Browse files
Ensure MP3 can safely exit on OOM (#716)
Fixes #715. Good catch, @EternityForest
1 parent 90b83fb commit aafabf2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/AudioGeneratorMP3.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ AudioGeneratorMP3::AudioGeneratorMP3()
2727
file = NULL;
2828
output = NULL;
2929
buff = NULL;
30+
synth = NULL;
31+
frame = NULL;
32+
stream = NULL;
3033
nsCountMax = 1152/32;
3134
madInitted = false;
3235
}
@@ -37,6 +40,9 @@ AudioGeneratorMP3::AudioGeneratorMP3(void *space, int size): preallocateSpace(sp
3740
file = NULL;
3841
output = NULL;
3942
buff = NULL;
43+
synth = NULL;
44+
frame = NULL;
45+
stream = NULL;
4046
nsCountMax = 1152/32;
4147
madInitted = false;
4248
}
@@ -51,6 +57,9 @@ AudioGeneratorMP3::AudioGeneratorMP3(void *buff, int buffSize, void *stream, int
5157
file = NULL;
5258
output = NULL;
5359
buff = NULL;
60+
synth = NULL;
61+
frame = NULL;
62+
stream = NULL;
5463
nsCountMax = 1152/32;
5564
madInitted = false;
5665
}

0 commit comments

Comments
 (0)