]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
stream : add nullptr check of whisper_context (#3283)
authorDaniel Bevenius <redacted>
Wed, 25 Jun 2025 12:16:31 +0000 (14:16 +0200)
committerGitHub <redacted>
Wed, 25 Jun 2025 12:16:31 +0000 (14:16 +0200)
commit1ad258ca31869f2af6479bffef4b8097da8d341d
tree3308ca120abdc44e3c526455c2028695b0b56d3b
parent7dd2997a01242e7eda5b1e557142d5b71c943edf
stream : add nullptr check of whisper_context (#3283)

* stream : add nullptr check of whisper_context

This commit adds a check to ensure that the `whisper_context` is not
null after initialization.

The motivation for this is that currently, if the initialization fails,
the program continues to run leading to a segmentation fault. This sort
of check is performed by others examples like whisper-cli.

Refs: https://github.com/ggml-org/whisper.cpp/issues/3280#issuecomment-3003778035

* examples : add nullptr check for whisper_context
examples/bench/bench.cpp
examples/command/command.cpp
examples/stream/stream.cpp
examples/vad-speech-segments/speech.cpp