mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-12-04 15:49:48 +00:00
Call to malloc may return NULL in SpectCreateFrame(spect.c) [msvc /analyze]
This commit is contained in:
@@ -101,6 +101,9 @@ static SpectFrame *SpectFrameCreate()
|
|||||||
SpectFrame *frame;
|
SpectFrame *frame;
|
||||||
|
|
||||||
frame = malloc(sizeof(SpectFrame));
|
frame = malloc(sizeof(SpectFrame));
|
||||||
|
if (!frame)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
frame->keyframe = 0;
|
frame->keyframe = 0;
|
||||||
frame->spect = NULL;
|
frame->spect = NULL;
|
||||||
frame->markers = 0;
|
frame->markers = 0;
|
||||||
@@ -336,6 +339,8 @@ espeak_ng_STATUS LoadSpectSeq(SpectSeq *spect, const char *filename)
|
|||||||
}
|
}
|
||||||
for (ix = 0; ix < n; ix++) {
|
for (ix = 0; ix < n; ix++) {
|
||||||
SpectFrame *frame = SpectFrameCreate();
|
SpectFrame *frame = SpectFrameCreate();
|
||||||
|
if (!frame)
|
||||||
|
return ENOMEM;
|
||||||
|
|
||||||
if (LoadFrame(frame, stream, spect->file_format) != 0) {
|
if (LoadFrame(frame, stream, spect->file_format) != 0) {
|
||||||
free(frame);
|
free(frame);
|
||||||
|
|||||||
Reference in New Issue
Block a user