Skip to content

Commit 96dae2f

Browse files
committed
whisper : zero-initialize some more context variables
Just in case
1 parent aad5295 commit 96dae2f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

whisper.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,11 @@ struct whisper_context {
592592

593593
mutable std::mt19937 rng; // used for sampling at t > 0.0
594594

595-
int lang_id;
595+
int lang_id = 0; // english by default
596596

597597
// [EXPERIMENTAL] token-level timestamps data
598-
int64_t t_beg;
599-
int64_t t_last;
598+
int64_t t_beg = 0;
599+
int64_t t_last = 0;
600600
whisper_token tid_last;
601601
std::vector<float> energy; // PCM signal energy
602602

@@ -4339,7 +4339,7 @@ int whisper_full_n_segments(struct whisper_context * ctx) {
43394339
}
43404340

43414341
int whisper_full_lang_id(struct whisper_context * ctx) {
4342-
return ctx->lang_id;
4342+
return ctx->lang_id;
43434343
}
43444344

43454345
int64_t whisper_full_get_segment_t0(struct whisper_context * ctx, int i_segment) {

0 commit comments

Comments
 (0)