Bug 213604 - [GTK] Initialize m_currentState and m_oldState
Summary: [GTK] Initialize m_currentState and m_oldState
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alicia Boya García
Depends on:
Reported: 2020-06-25 07:53 PDT by Alicia Boya García
Modified: 2020-06-26 06:36 PDT (History)
13 users (show)

See Also:

Patch (2.22 KB, patch)
2020-06-25 08:13 PDT, Alicia Boya García
no flags Details | Formatted Diff | Diff
Patch for landing (2.22 KB, patch)
2020-06-26 06:15 PDT, Alicia Boya García
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alicia Boya García 2020-06-25 07:53:11 PDT
While working on another issue I noticed this line in the log...

0:00:06.798920099    26 0x5644fb378ec0 DEBUG      webkitmediaplayer MediaPlayerPrivateGStreamer.cpp:1463:playbin3SendSelectStreamsIfAppropriate:<media-player-0> Checking if to send SELECT_STREAMS, m_waitingForStreamsSelectedEvent = false, haveDifferentStreamIds = false, m_currentState = UNKNOWN!(-8421505)... shouldSendSelectStreams = false

m_currentState is used before being initialized!

    GstState m_currentState;
    GstState m_oldState;

This is not only affecting a debug statement, but also affects updateStates():

    GstStateChangeReturn getStateResult = gst_element_get_state(m_pipeline.get(), &state, &pending, 250 * GST_NSECOND);
    if (state != m_currentState) {
        m_oldState = m_currentState;
        m_currentState = state;
        stateReallyChanged = true;

This patch initializes both m_currentState and m_oldState to GST_STATE_NULL.
Comment 1 Alicia Boya García 2020-06-25 08:13:31 PDT
Created attachment 402736 [details]
Comment 2 Alicia Boya García 2020-06-26 06:15:19 PDT
Created attachment 402858 [details]
Patch for landing
Comment 3 EWS 2020-06-26 06:36:48 PDT
Committed r263556: <https://trac.webkit.org/changeset/263556>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 402858 [details].