mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 03:28:25 +03:00
LibVideo: Initialize primitive member variables in PlaybackManager
Using uninitialized primitives is undefined behavior. In this case, all videos would autoplay on Serenity, but not play at all on Lagom, due to some m_playing booleans being uninitialized.
This commit is contained in:
parent
560133a0c6
commit
0f2b863c01
Notes:
sideshowbarker
2024-07-17 08:43:11 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/0f2b863c01 Pull-request: https://github.com/SerenityOS/serenity/pull/18264
@ -314,7 +314,7 @@ protected:
|
||||
return {};
|
||||
}
|
||||
|
||||
bool m_playing;
|
||||
bool m_playing { false };
|
||||
};
|
||||
|
||||
class PlaybackManager::StartingStateHandler : public PlaybackManager::ResumingStateHandler {
|
||||
@ -362,7 +362,7 @@ class PlaybackManager::StartingStateHandler : public PlaybackManager::ResumingSt
|
||||
return {};
|
||||
}
|
||||
|
||||
bool m_playing;
|
||||
bool m_playing { false };
|
||||
};
|
||||
|
||||
class PlaybackManager::PlayingStateHandler : public PlaybackManager::PlaybackStateHandler {
|
||||
|
@ -156,7 +156,7 @@ private:
|
||||
NonnullOwnPtr<PlaybackStateHandler> m_playback_handler;
|
||||
Optional<FrameQueueItem> m_next_frame;
|
||||
|
||||
u64 m_skipped_frames;
|
||||
u64 m_skipped_frames { 0 };
|
||||
|
||||
// This is a nested class to allow private access.
|
||||
class PlaybackStateHandler {
|
||||
|
Loading…
Reference in New Issue
Block a user