xiph / speexdsp

Speex audio processing library - THIS IS A MIRROR, DEVELOPMENT HAPPENS AT https://gitlab.xiph.org/xiph/speexdsp
https://speex.org
Other
469 stars 190 forks source link

Handle memory allocation failures during initialization #1

Closed jyavenard closed 8 years ago

jyavenard commented 8 years ago

Should an OOM occur during initialisation (speex_resampler_init), it would lead to various crashes or null deref.

The loop initialising last_sample[], magic_samples[] and samp_frac_num[] is unnecessary as memory is allocated via cmalloc which already sets it to 0. but I guess it's a superfluous optimisation.

rillian commented 8 years ago

r? @tmatth