Bug 213604

Summary: [GTK] Initialize m_currentState and m_oldState
Product: WebKit Reporter: Alicia Boya García <aboya>
Component: WebKitGTKAssignee: Alicia Boya García <aboya>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, calvaris, cgarcia, eric.carlson, ews-watchlist, glenn, gustavo, jer.noble, menard, philipj, pnormand, sergio, vjaquez
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

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]
Patch
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].